mail from gmail goes to softfail by yahoo with SPF record

1k views Asked by At

I have my own domain, i.e mydomain.com and own email [email protected] from which I can send email by php script. I also have custom gmail address (from google apps) [email protected] and can login go gmail email panel and can send email from that gmail account.

What usually happens are: 1) I send email (sender: [email protected]) from my domain by php script and also send email (sender: [email protected]) from gmail (google apps).

2) All email comes to [email protected] are received in gmail account, not in domain's webmail.

For this reason, I created the SPF record in Advanced DNS management of my domain as below:

v=spf1 mx a:google.com ~all

Now when I send email from my domain (by php script using smtp) to [email protected], I found SPF: pass in header of the sent mail.

But while I send email from gmail account to [email protected], I found SPF:softfail in header of the sent mail.

What will be the correct syntax of SPF record by which both the email sent will be passed the SPF, sent from my domain and gmail account.

2

There are 2 answers

1
Kurt On

Best way is to include Google's own SPF record:

v=spf1 mx include:gmail.com ~all

You are currently using an A-record lookup to the google.com domain, which does not corresponds to IP addresses of their actual SMTP servers.

0
Sarsaparilla On

From here: https://support.google.com/a/answer/178723

v=spf1 include:_spf.google.com ~all

Allowing me to use Gmail to send From: [email protected] with SPF=pass