My website sends mails to users. This has been working wonderfully for years. But since a year or so, gmail blocks mails in the following scenario: A user has the email [email protected]. That email is automatically forwarded to a gmail address, so there is probably not a mailbox installed but just an automatic forwarding.
In that scenario, gmail will block the email with the error:
host gmail-smtp-in.l.google.com [xx.xx.xx.xx]
SMTP error from remote mail server after end of data:
550-5.7.26 This message does not pass authentication checks (SPF and DKIM both
550-5.7.26 do not pass). SPF check for [xyz.com] does not pass with
550-5.7.26 ip: [xx.xx.xx.xx].To best protect our users from spam, the message
550-5.7.26 has been blocked
If the same mail is sent to the gmail address directly, everything works as expected.
I have setup an SPF record like this:
v=spf1 mx ip4:ip.of.web.site ~all
RDNS is setup correctly.
EDIT: Reading about this issue further, one user suggested to add include:_spf.google.com to make the SPF record look like this:
v=spf1 mx ip4:ip.of.web.site include:_spf.google.com ~all
Although I can not see why this would help in my case, the number of failed checks seems to have dropped significantly. Of course, I do not think this qualifies as a proper solution, more as a hack at the most.
I will still try to setup DKIM, though.