RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1294870 - can't send email to domain with mx pointing to cname from ipv6 enabled server
Summary: can't send email to domain with mx pointing to cname from ipv6 enabled server
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sendmail
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: Roman Žilka
URL:
Whiteboard:
Depends On:
Blocks: 1400961
TreeView+ depends on / blocked
 
Reported: 2015-12-30 19:20 UTC by Joe Pruett
Modified: 2017-08-01 12:42 UTC (History)
5 users (show)

Fixed In Version: sendmail-8.14.7-5.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 12:42:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
fix sm_gethostby* routines to deal with cnames better (2.01 KB, patch)
2015-12-30 22:37 UTC, Joe Pruett
no flags Details | Diff
Backported fix (2.02 KB, patch)
2016-01-04 09:57 UTC, Jaroslav Škarvada
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2197 0 normal SHIPPED_LIVE sendmail bug fix and enhancement update 2017-08-01 16:09:20 UTC

Description Joe Pruett 2015-12-30 19:20:58 UTC
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.

Comment 2 Joe Pruett 2015-12-30 22:37:41 UTC
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.

Comment 3 Jaroslav Škarvada 2016-01-04 09:57:23 UTC
Created attachment 1111426 [details]
Backported fix

Thanks for the backported patch. I only changed its header to apply.

Comment 4 Joe Pruett 2016-01-04 16:34:07 UTC
how long might it take to show up in an official build?

Comment 5 Jaroslav Škarvada 2016-01-04 17:49:04 UTC
(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.

Comment 8 Roman Žilka 2017-05-31 14:44:22 UTC
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
#

Comment 9 errata-xmlrpc 2017-08-01 12:42:36 UTC
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


Note You need to log in before you can comment on or make changes to this bug.