Resolving IPv6 issues with GMail using qmail smtp
In case you are running into problems with Google Mail (GMail) rejecting mail from your qmail server running on native IPv6 with the following message
2a00:1450:4013:0c01:0000:0000:0000:001a failed after I sent the message. Remote host said: 550-5.7.1 [xxx:xxx:xxx:xxx::x 12] Our system has detected that this 550-5.7.1 message is likely unsolicited mail. To reduce the amount of spam sent 550-5.7.1 to Gmail, this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. e7si30051500wiy.79 – gsmtp
make sure that you double-check the following settings:
- MX record matches the hostname set in qmail, /var/qmail/control/me
- Reverse DNS record for your server IP, i.e. PTR record, for both IPv6 and IPv4
- SPF records are set properly and point to your MX records and server IP for both IPv6 and IPv4
Check MX record
First of all make sure that you MX records match the hostname set in the qmail configuration. You can check your MX settings using the MXToolbox.
Check Reverse DNS record – PTR record
Second, make sure that your IPv4 and especially IPv6 IPs have a PTR record that resolves to the MX entry set for your domain. You can check your Reverse DNS lookup using the MXToolbox.
Check SPF record
Finally, GMail (and probably other mail providers too) will check for correct SPF or DKIM records. Normally, the SPF record only is sufficient. Checkout the SPFWizard on how to assemble your IN TXT SPF record. Make sure to add entries for IPv6 too, e.g.
v=spf1 mx a ip4:xx.xx.xx.xx ip6:y:yyyy:yyy:yyy:yyyy::y include:mail.yourserver.com include:mail2.yourserver.com -all
Finally, check your server setup by either sending out mail to GMail recipients or testing it with the excellent Allaboutspam e-mail tester. That should get qmail working with native IPv6 support and GMail.