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.

I have an email server configured with multiple-instance of sendmail running each on different IPv4 and IPv6 addresses. Everything is running smooth until a point where for some domains/emails (apparently random) sendmail try to send the email from the IPv6 address instead of the IPv4 and I begin to receive messages like:

SYSERR(root): makeconnection: cannot bind socket [IPv6:2001:db8::2]: Address family not supported by protocol
to=<xxx@bad-domain.example>, delay=04:23:07, xdelay=00:00:00, mailer=esmtp, pri=11918385, relay=bad-domain.example. [198.51.100.5], dsn=4.0.0, stat=Deferred: Address family not supported by protocol

The IPv6 and IPv4 addresses was obfuscated.

What I observed, but I'm not sure that this is the issue, the MX record for the bad-domain is a CNAME instead of direct A or AAAA record.

I'm using Sendmail 8.14.5 on Fedora 16 all the IP's are statically configured (IPv4 + IPv6) If the base issue can't be solved there is a way to instruct sendmail to use only IPv4 for a list of specified domains ?

An extract from the sendmail.mc:

CLIENT_OPTIONS(`Family=inet,Addr=192.0.2.2')dnl
CLIENT_OPTIONS(`Family=inet6,Addr=2001:db8::2')dnl
DAEMON_OPTIONS(`Name=MTA-v4,Family=inet,Addr=192.0.2.2')dnl
DAEMON_OPTIONS(`Name=MTA-v6,Family=inet6,Addr=2001:db8::2')dnl

some example for bad-domain: donpac.ru, montevideo.com.uy, dalia-ingenierie.fr, opela.cz, orange.net, poisl.com.br, tamil.com, zerong.cn

LE: all seems to have a CNAME as MX record and no one of the CNAME's resolv to IPv6

share|improve this question
    
I edited the Question to include a part from the config file. –  szjozsef Feb 24 '13 at 20:30
    
Yes. Is working perfectly for a few hours sending hundred of emails, but after a while maybe because of some strange destionation address, begins to try to send from IPv6 to IPv4 destinations.... –  szjozsef Feb 24 '13 at 20:51
    
It seems the issue is with non-RFC compliant domains which has MX servers which resolves to CNAME records instead of A records. An example domain: orange.net, their MX records is: smtp-in.orange.net which resolves to : CNAME mail-in.freeserve.com which resolves to an IP address. More example domains: donpac.ru, montevideo.com.uy –  szjozsef Feb 24 '13 at 21:00
    
This is my question also, respectively is there any method to force the delivery in IPv4 for this kind of domains ? –  szjozsef Feb 24 '13 at 21:20
    
None of those MX records/CNAME's end up with IPv6 addresses; they're all IPv4. So my best guess is.. obscure Sendmail bug? –  Michael Hampton Feb 24 '13 at 21:21

1 Answer 1

Whilst the comments above seem to suggest that this isn't a v4-by-domain issue, I had cause to need to do exactly what you describe, today, and found this question whilst searching.

The method I found to force v4 delivery on a domain-by-domain basis is to enable mailertable, by having

FEATURE(`mailertable')

in my sendmail.mc (if it's already there, you don't need to add it again). Then I force v4-based delivery by overriding the DNS And instructing delivery to go to a v4 address in the mailertable file; this is from /etc/mail/mailertable:

.example.com    esmtp:[260.240.18.38]
example.com     esmtp:[260.240.18.38]

I don't normally redact domain names, but I don't wish to embarrass the colleagues who have wrongly implemented smtp-over-ipv6, and thus need me to force delivery over v4. The IP address is obviously false, also; but in production it's the v4 address of their primary MX, taken from the DNS.

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.