Why does Google reject the outgoing emails

domain-name-systemgmailspf

I have the following DNS records set up for my mailserver (obfuscated Domain and IPs):

mydomain.net.       86400   IN      A      109.83.50.87
mydomain.net.       86400   IN      AAAA   2a00:5080:7:13::1
mydomain.net.       86400   IN      MX     10 mail.mydomain.net.
mydomain.net.       86400   IN      TXT    "v=spf1 mx -all"

mail.mydomain.net.  86400   IN      A       109.83.50.87
mail.mydomain.net.  86400   IN      AAAA    2a00:5080:7:13::1

This setup passes any SPF verification tool I could find on the net.

However, if I try to send mail to a gmail account and the server decides to connect via IPv6 to the receiving Google SMTP, the message gets rejected with this bounce:

<receiver@gmail.com>: host gmail-smtp-in.l.google.com[2a00:1450:4001:c02::1b]
  said: 550-5.7.1 [2a00:5080:7:13::1      16] The sender does not meet basic
  ipv6 550-5.7.1 sending guidelines of authentication and rdns resolution of
  sending 550-5.7.1 ip. Please review 550 5.7.1
  https://support.google.com/mail/answer/81126for more information.
  o6si5388522eea.99 - gsmtp (in reply to end of DATA command)

I suspect that something is wrong with my SPF records, but what? What else might be the cause for this?

I haven't tried setting the authorized IPs with 'ip4:xxxx.xxxx…' and 'ip6:xxxx:xxx…' instead of 'mx' yet, but I don't like that way.

Best Answer

Looks like your ipv6 sending address doesn't have PTR record. According to google support page:

Additional guidelines for IPv6

The sending IP must have a PTR record (i.e., a reverse DNS of the sending IP) and it should match the IP obtained via the forward DNS resolution of the hostname specified in the PTR record. Otherwise, mail will be marked as spam or possibly rejected.

Related Topic