Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
2  
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

3 Answers 3

up vote 4 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.

share|improve this answer
    
And what if you VPS provider don't want to set the SPF record for IPv6. :( –  brodul Sep 9 '13 at 19:36
    
@brodul What does your VPS provider have to do with your DNS records? –  Michael Hampton Sep 9 '13 at 19:37

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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