Today I noticed that Gmail sends all messages received from my server to the Spam folder. I checked message header and found the following:

Authentication-Results: mx.google.com;
       spf=neutral (google.com: 2001:4ba0:cafe:........ is neither permitted nor denied by best guess record for domain of root@myserver.com) smtp.mail=root@myserver.com

So, it looks that Sendmail is sending mail from IP6 adress insrtead of IPv4 and there is no SPF and PTR records for IPv6. How do I force Sendmail to send mail from IPv4?

Thanks.

  • 3
    Since you HAVE v6 connectivity, it'd be better if you could add the reverse lookup and MX record for your v6-compatible mailer. But, that's not what you're asking. – sysadmin1138 Jun 2 '13 at 12:08
up vote 5 down vote accepted

Don't disable IPv6. It is not optional anymore and you will not be able to communicate with some people without it.

Instead, fix your SPF record so that it passes mail originating from your IPv6 address.

  • And what if you VPS provider don't want to set the SPF record for IPv6. :( – brodul Sep 9 '13 at 19:36
  • 1
    @brodul What does your VPS provider have to do with your DNS records? – Michael Hampton Sep 9 '13 at 19:37
  • Fixing my SPF record doesn't solve the problem - because I'm forwarding mail to GMail, so my forwarding server will never pass an SPF check. – James Roper Aug 4 '17 at 3:34
  • Gmail now also requires a working reverse for IPv6 senders. Having a working reverse address is definitely out of your hands and up to your server/network provider. – Vladimir Panteleev Jan 23 at 11:56

In your sendmail.mc add:

CLIENT_OPTIONS(`Family=inet')dnl

Then rebuild sendmail.cf and restart sendmail. In Debian you do this by running >sendmailconfig. In CentOS you run /etc/mail/make followed by service sendmail restart. Other >systems have other ways to do this.

Thanks for posting this, and it definitely got me on the right track. However, I tried this, but it was still not working for me. As a side note, we were getting rejections from Google mail servers because we didn't have a reverse DNS entry for IPv6. This is definitely related to our VPS's configuration, and not our DNS configuration, because the numeric reverse DNS entry has to go to whoever owns the block of IP addresses, and that's my VPS.

Anyway, as far as I can see, there is no way to specifically turn off sendmail using IPv6 as the client. The slightly tricky resolution I came to was to specify the IPv6 options to use an IPv6 compatibility format of an IPv4 address.

e.g. if your IPv4 address is 1.2.3.4, specify:

CLIENT_OPTIONS(`Family=inet6,Addr=::ffff:1.2.3.4')dnl

Worked a charm for me, and as far as I can see, this hasn't been documented anywhere.

In your sendmail.mc add:

CLIENT_OPTIONS(`Family=inet')dnl

Then rebuild sendmail.cf and restart sendmail. In Debian you do this by running sendmailconfig. In CentOS you run /etc/mail/make followed by service sendmail restart. Other systems have other ways to do this.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.