Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sendmail tries to resolve domains in To: header

49 views
Skip to first unread message

mattgoogle

unread,
Oct 27, 2009, 5:32:56 PM10/27/09
to
While tring to figure out why certain messages always time out with a
SYSERR / "Broken pipe" on my inbound sendmail (8.14.3) relay, I used
strace and noticed that sendmail is trying to resolve every domain in
the To: header of the message. Aside from the actual problem (see
below), this behavior seems weird to me, as I always thought the To:
field was irrelevant to sendmail except for local submission using -
t . Am I mistaken?

The actual cause of the timeouts was a domain (imefdm.usmc.mil) in the
To: field that has a bad nameserver that just hangs without returning
anything. This dns hang was causing sendmail to timeout while
relaying to my inner mailhost and thus sendmail would defer the
message. But that domain is not local to me, nor is it the domain of
the sender -- it should really have nothing to do with delivery of the
message AFAICT. Also, sendmail has already accepted all my valid
local recipients and figured out where to relay them to. Why is it
then scanning the header of the message and tying to resolve non-local
domains at that point?

This seemed to start when upgrading sendmail from 8.14.2 to 8.14.3.

Thanks in advance for any tips.

-Matt

mattgoogle

unread,
Oct 28, 2009, 4:26:38 PM10/28/09
to
Following up to myself... I've determined that the Broken pipes &
SYSERRs were due to the default 60-second timeouts in the tcpproxy
between the two SMTP relay hosts (1 minute is just a bit too short for
the slow DNS query made during the relay attempt).

But the question still remains... why is sendmail resolving domains in
addresses in the To: field? Is there a configuration setting I can
use to disable this behavior?

Thanks...

Andrzej Adam Filip

unread,
Oct 28, 2009, 4:48:38 PM10/28/09
to

It is a "very long lasting tradition" of "do not fix what is not broken" :-)

Sendmail is capable to rewrite "header recipients" addresses
e.g. by default it replaces CNAMES (DNS "aliases" records) by their true name.
You can stop it by using FEATURE(`nocanonify')

http://www.sendmail.org/m4/features.html#nocanonify

--
[pl>en Andrew] Andrzej Adam Filip : an...@onet.eu : Andrze...@gmail.com
Sorry. My testing organization is either too small, or too large,
depending on how you look at it. :-)
-- Larry Wall in <1991Apr22....@jpl-devvax.jpl.nasa.gov>

mattgoogle

unread,
Oct 28, 2009, 5:17:10 PM10/28/09
to
On Oct 28, 4:48 pm, Andrzej Adam Filip wrote:
> Sendmail is capable to rewrite "header recipients" addresses
> e.g. by default it replaces CNAMES (DNS "aliases" records) by their true name.
> You can stop it by using FEATURE(`nocanonify')


Thanks, Andrzej, for your reply. I did try that in both sendmail.mc
and submit.mc (since I am testing from the command line), however I am
still getting the DNS query (and hence the delay).

Here is the simplest test case I can think of:

# hostname
mail.example.com
# cat <<EOF > msg
To: <fakerem...@imefdm.usmc.mil>
Subject: testing

Hi.
EOF
# sendmail localuser@localhost < msg


This message will take abount a minute to go through, due to the slow
DNS query for imefdm.usmc.mil, even though that domain has nothing to
do with delivery of the message. Running the command with -v shows
the delay at the DATA stage. strace reveals the name resolution
attempts at that point. This happens even with FEATURE(nocanonify) in
effect. I'm not even doing any masquerading or generics, so I can't
figure out what reason sendmail would have to look in the headers?

Thanks ....

-Matt

Andrzej Adam Filip

unread,
Oct 30, 2009, 1:28:04 PM10/30/09
to

Sorry for "lack of full procession".
To get equivalent of FEATURE(`nocanonify') in submit.cf use the line
below in submit.mc and recompile it:

define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl

URL(s):
http://anfi.homeunix.org/sendmail/dialup10.html

--
[pl>en Andrew] Andrzej Adam Filip : an...@onet.eu : Andrze...@gmail.com

Open-Sendmail: http://open-sendmail.sourceforge.net/
Vulcans worship peace above all.
-- McCoy, "Return to Tomorrow", stardate 4768.3

0 new messages