Hide Forgot
Description of problem: an ipv6 enabled server running sendmail has trouble sending to sites that have bad dns where their mx record points to a cname. i think it may only crop up with messages that get queued, or perhaps are being relayed from another ipv6 server. Version-Release number of selected component (if applicable): sendmail-8.14.7-4.el7.x86_64 How reproducible: first you have to have a domain with mx pointing to a cname. i don't want to shame the domains i've been having issues with, but it can be easily created in a test environment. make sure server has ipv6 enabled, not sure if explicit ClientPortOptions need to be set for family=inet6, but i do have that as well. try to send email to the broken domain and you should see it get stuck in the queue with an error of "makeconnection: cannot bind socket [IPv6:XXXX::XXXX]: Address family not supported by protocol" Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: i have found people seeing this issue back a few years (http://serverfault.com/questions/482035/sendmail-issue-with-ipv6), so it seems to be a pretty old bug. and i see others talking about the underlying issue with gethostbyname and RES_USE_INET6 and cnames causing confusion (https://sourceware.org/bugzilla/show_bug.cgi?id=3425), which seems to be the root cause of this. debugging sendmail via -d61.99 will show some odd results from the gethostbyname lookup when cnames are involved. the workaround is to create local mailertable mappings for the broken domains.
Created attachment 1110655 [details] fix sm_gethostby* routines to deal with cnames better i grabbed the latest copy of sendmail and found that it had fixed the problem. i was able to make a smallish patch to fix just this issue in the sm_gethostby* functions. if gethostbyname returns addresses that aren't in the right address family, it rejects them, which then causes higher levels to retry correctly. i'm attaching the patch, hoping it can go into an official release.
Created attachment 1111426 [details] Backported fix Thanks for the backported patch. I only changed its header to apply.
how long might it take to show up in an official build?
(In reply to Joe Pruett from comment #4) > how long might it take to show up in an official build? I am unable to say, it depends on PM, QA, and other factors. You can speed the process up by escalation through the support channel. Currently it's ready from the engineering point of view.
QA: Verified. ******************** ******************** sendmail-8.14.7-4.el7 (faulty): ******************** # grep CLIENT_OPTIONS /etc/mail/sendmail.mc CLIENT_OPTIONS(`Family=inet,Addr=127.0.0.1')dnl CLIENT_OPTIONS(`Family=inet6,Addr=::1')dnl # nslookup -type=mx dummydomain.cz Server: 127.0.0.1 Address: 127.0.0.1#53 dummydomain.cz mail exchanger = 10 cnamemyself.dummydomain.cz. # nslookup cnamemyself.dummydomain.cz Server: 127.0.0.1 Address: 127.0.0.1#53 cnamemyself.dummydomain.cz canonical name = myself.dummydomain.cz. Name: myself.dummydomain.cz Address: 127.0.0.1 # echo QA|mail root # sleep 100 # grep dummydomain /var/log/maillog May 31 10:08:46 localhost sendmail[11375]: v4VE7PfU011375: to=root, ctladdr=root (0/0), delay=00:01:21, xdelay=00:01:21, mailer=relay, pri=30225, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v4VE7PQA011376 Message accepted for delivery) May 31 10:08:46 localhost sendmail[11380]: v4VE7PQA011376: to=<root>, ctladdr=<root> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=120543, relay=cnamemyself.dummydomain.cz. [127.0.0.1], dsn=4.0.0, stat=Deferred: Address family not supported by protocol # mailq /var/spool/mqueue (1 request) -----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient----------- v4VE7PQA011376 3 Wed May 31 10:08 <root> (makeconnection: cannot bind socket [IPv6:::1]: Address famil) <root> Total requests: 1 # ******************** ******************** sendmail-8.14.7-5.el7 (fixed): ******************** # grep CLIENT_OPTIONS /etc/mail/sendmail.mc CLIENT_OPTIONS(`Family=inet,Addr=127.0.0.1')dnl CLIENT_OPTIONS(`Family=inet6,Addr=::1')dnl # nslookup -type=mx dummydomain.cz Server: 127.0.0.1 Address: 127.0.0.1#53 dummydomain.cz mail exchanger = 10 cnamemyself.dummydomain.cz. # nslookup cnamemyself.dummydomain.cz Server: 127.0.0.1 Address: 127.0.0.1#53 cnamemyself.dummydomain.cz canonical name = myself.dummydomain.cz. Name: myself.dummydomain.cz Address: 127.0.0.1 # echo QA|mail root # sleep 100 # grep dummydomain /var/log/maillog May 31 10:01:08 localhost sendmail[11370]: v4VDxmKa011370: to=root, ctladdr=root (0/0), delay=00:01:20, xdelay=00:01:20, mailer=relay, pri=30225, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v4VDxmdd011371 Message accepted for delivery) May 31 10:01:08 localhost sendmail[11403]: v4VDxmdd011371: SYSERR(root): cnamemyself.dummydomain.cz. config error: mail loops back to me (MX problem?) May 31 10:01:08 localhost sendmail[11403]: v4VDxmdd011371: to=<root>, ctladdr=<root> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120543, relay=cnamemyself.dummydomain.cz. [127.0.0.1], dsn=5.3.5, stat=Local configuration error # mailq /var/spool/mqueue is empty Total requests: 0 #
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:2197