1838481 Members
2802 Online
110126 Solutions
New Discussion

sendmail DNS problem

 
Erich Donze
Occasional Advisor

sendmail DNS problem

Everything was working with sendmail 8.11.x, but when I upgraded(?) to 8.13, the issues with DNS and sendmail started again. I've tried many things already to resolve this, and I have DNS deconfigured in most places, but sendmail re-writes the RCPT To: address with information from DNS, which is accurate, but does not match the recipient policy in exchange. I was able to get it working by renaming /etc/resolv.conf, but then DNS doesn't work. I will attempt to enumerate the things I've tried (although I may miss a couple) to try to keep the repeats to a minimum. The server (There's basically only one) we want to send mail to has an entry in /etc/hosts, but of course, it isn't an MX record.

My /etc/nsswitch.conf:

aliases: files
sendmailvars: files
hosts: files [NOTFOUND=continue] dns

I tried duplicating and modifying this as an /etc/mail/service.switch with the corresponding pointer in /etc/mail/sendmail.cf

Highlights of /etc/mail/sendmail.cf

O TryNullMXList=T

O ServiceSwitchFile=/etc/mail/service.switch

DSmiracosta.edu
# I've tried the smart host with and without sqaure brackets

O ResolverOptions=-DNSRCH


Msmtp, P=[IPC], F=0mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=TCP $h
# I added the 0 after F= in the above line.

Here is the output of a test message:
# test | sendmail -v -d8.99 username@short.domain.name
;; res_querydomain(myhost, short.domain.name, 1, 1)
;; res_query(myhost.short.domain.name, 1, 1)
;; Querying server (# 1) address = 10.10.14.14
dns_getcanonname(short.domain.name, trymx=1)
dns_getcanonname: trying short.domain.name. (AAAA)
;; res_querydomain(short.domain.name, , 1, 28)
;; res_query(short.domain.name., 1, 28)
;; Querying server (# 1) address = 10.10.14.14
YES
dns_getcanonname: trying mailserver.long.domain.name. (AAAA)
;; res_querydomain(mailserver.long.domain.name, , 1, 28)
;; res_query(mailserver.long.domain.name., 1, 28)
;; Querying server (# 1) address = 10.10.14.14
;; rcode = 0, ancount=0
NO: errno=0, h_errno=4
dns_getcanonname: trying mailserver.long.domain.name. (A)
;; res_querydomain(mailserver.long.domain.name, , 1, 1)
;; res_query(mailserver.long.domain.name., 1, 1)
;; Querying server (# 1) address = 10.10.14.14
YES
dns_getcanonname: mailserver.long.domain.name
getmxrr(short.domain.name, droplocalhost=1)
;; res_querydomain(short.domain.name, , 1, 15)
;; res_query(short.domain.name, 1, 15)
;; Querying server (# 1) address = 10.10.14.14
unexpected answer type 5, size 29
username@short.domain.name... Connecting to short.domain.name via relay...
;; res_querydomain(short.domain.name, , 1, 1)
;; res_query(short.domain.name, 1, 1)
;; Querying server (# 1) address = 10.10.14.14
;; res_query(140.17.10.10.in-addr.arpa, 1, 12)
;; Querying server (# 1) address = 10.10.14.14
;; res_querydomain(myhost.miracosta.cc.ca.us., , 1, 1)
;; res_query(myhost.miracosta.cc.ca.us, 1, 1)
;; Querying server (# 1) address = 10.10.14.14
220 mailserver.long.domain.name Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Thu, 6 Jul 2006 10:21:00 -0700
>>> EHLO myhost.short.domain.name
250-mailserver.long.domain.name Hello [10.10.17.140]
250-TURN
250-SIZE 15912960
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250-X-EXPS GSSAPI NTLM LOGIN
250-X-EXPS=LOGIN
250-AUTH GSSAPI NTLM LOGIN
250-AUTH=LOGIN
250-X-LINK2STATE
250-XEXCH50
250 OK
>>> MAIL From: AUTH=root@myhost.short.domain.name
250 2.1.0 root@myhost.short.domain.name....Sender OK
>>> RCPT To:
>>> DATA
250 2.1.5 username@mailserver.long.domain.name
354 Start mail input; end with .
>>> .
250 2.6.0 <200607061721.k66HL0lQ016819@myhost.short.domain.name> Queued mail for delivery
username@short.domain.name... Sent ( <200607061721.k66HL0lQ016819@myhost.short.domain.name> Queued mail for delivery)
Closing connection to short.domain.name
>>> QUIT
221 2.0.0 mailserver.long.domain.name Service closing transmission channel

Any help you can provide would be ...helpful.
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: sendmail DNS problem

Shalom,

There may be a binary patch to fix this.

Maybe here:
https://h30046.www3.hp.com/subprofile.php?regioncode=NA&langcode=USENG&jumpid=in_SC-GEN__driverITRC&subs=ITRC

You may wish to check http://software.hp.com for a new release.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Erich Donze
Occasional Advisor

Re: sendmail DNS problem

The link takes me to update my profile on ITRC, and then to ITRC home. The version of sendmail is 8.13.3, which is the latest from software.hp.com. Thanks for the quick response, though.
Steven E. Protter
Exalted Contributor

Re: sendmail DNS problem

Sorry about the link.

I'd consider backing out the sendmail release. First check with the response center, they may have a binary fix for you.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Erich Donze
Occasional Advisor

Re: sendmail DNS problem

Its working. HP's response said "Change the following in the sendmail.cf:

>From:

# pass to name server to make hostname canonical
R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4

to:

# pass to name server to make hostname canonical
#R$* < @ $* $~P > $* $: $1 < @ $[ $2 $3 $] > $4


ALSO from:

Msmtp, P=[IPC], F=mDFMuX, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Mesmtp, P=[IPC], F=mDFMuXa, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Msmtp8, P=[IPC], F=mDFMuX8, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Mrelay, P=[IPC], F=mDFMuXa8, S=11/31, R=61, E=\r\n, L=2040,
T=DNS/RFC822/SMTP,
A=IPC $h


TO:

Msmtp, P=[IPC], F=0mDFMuX, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Mesmtp, P=[IPC], F=0mDFMuXa, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Msmtp8, P=[IPC], F=0mDFMuX8, S=11/31, R=21, E=\r\n, L=990,
T=DNS/RFC822/SMTP,
A=IPC $h
Mrelay, P=[IPC], F=0mDFMuXa8, S=11/31, R=61, E=\r\n, L=2040,
T=DNS/RFC822/SMTP,
A=IPC $h


Basically, comment out one line and add '0' (zero) after the F= in each of
the 4 lines.
Stop and restart Sendmail."

The lines in the first part of my sendmail.cf didn't match exactly. Mine looked like:
# hostnames ending in class P are always canonical
R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
----> R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3
> $4
R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
R$* CC $* $| $* $: $3

I also had to make the changes in submit.cf before the changes took effect.