I've set up Postfix and created an alias that maps to a gmail account. When I mail from one of my own (google mail) accounts, it goes through, but if someone from the outside mails me, Google won't accept the mail from my server. The logs something contains this:
Aug 20 13:47:09 Ubuntu-1204-precise-64-minimal postfix/smtpd: connect from mailout.example.com[22.214.171.124] Aug 20 13:47:09 Ubuntu-1204-precise-64-minimal postfix/smtpd: DB399E3318: client=mailout.example.com[126.96.36.199] Aug 20 13:47:09 Ubuntu-1204-precise-64-minimal postfix/cleanup: DB399E3318: message-id=<015e01ce9d9a$f988a750$ec99f5f0$@dk> Aug 20 13:47:09 Ubuntu-1204-precise-64-minimal postfix/qmgr: DB399E3318: from=<email@example.com>, size=3813, nrcpt=1 (queue active) Aug 20 13:47:09 Ubuntu-1204-precise-64-minimal postfix/smtpd: disconnect from mailout.example.com[188.8.131.52] Aug 20 13:47:10 Ubuntu-1204-precise-64-minimal postfix/smtp: DB399E3318: to=<firstname.lastname@example.org>, orig_to=<email@example.com>, relay=gmail-smtp-in.l.google.com[2a00:1450:4010:c04::1b]:25, delay=1.1, delays=0.22/0/0.14/0.76, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[2a00:1450:4010:c04::1b] said: 550-5.7.1 [2a01:4f8:d12:11c2::2 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. qh9si1111170lbb.172 - gsmtp (in reply to end of DATA command))
The relevant part seems to be:
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/81126 for more information.
Any idea how I can solve this?
On the mails that do come through, I find the following headers:
Received-SPF: neutral (google.com: 184.108.40.206 is neither permitted nor denied by best guess record for domain of firstname.lastname@example.org) client-ip=220.127.116.11; Authentication-Results: mx.google.com; spf=neutral (google.com: 18.104.22.168 is neither permitted nor denied by best guess record for domain of email@example.com) firstname.lastname@example.org
Now, the curious thing is that it appears that Google is evaluating my server against the SPF of the original sender. This is a third party, so I can't control their SPF. If I'm interpreting this correctly, Google thinks that my server is the origin of the message. Is this perhaps the crux of the problem?
It looks like I have the same problem as this: Why is SPF being validated against my mail server's IP instead of sender's IP?
So I've fixed the spf issue by installing
pfix-srs and setting an spf record for my mail server. I followed this guide (Had to install some packages manually, since they aren't available for Ubuntu): http://blog.phusion.nl/2012/09/10/mail-in-2012-from-an-admins-perspective/
This appears to solve the spf issue (The mails now pass spf), but alas, mail is still getting dropped from some senders. I'm now trying to set the rdns entry and see if it resolves. I'll post back here once I know.
It worked. In summary, what I did to resolve this was:
- Create an spf record for my mail servers domain, allowing my ip4 and ip6 to send. (E.g.
v=spf1 ip4:22.214.171.124 ip6:abcd:abc:123:4567::8 ~all)
- Create an rdns entry for my mail severs domain, pointing to its IP.