CentOS 5.x | SendMail 8.14

I've got a sendmail server that is configured to be the last hop out. It performs DNS lookup for outbound messages and attempts to deliver them to the recipient mail host.

For some reasons, the server is experiencing delays sending to one recipient domain and the logs suggest that it's trying certain recipient MX records out of order.


recipientfoo.com      MX preference = 10 mail.cloudfoo.com 
recipientfoo.com      MX preference = 20 backup.recipientfoo.com 
recipientfoo.com      MX preference = 30 backup2.recipientfoo.com

In this case, I would expect to see the an initial attempt to mail.cloudfoo.com first... but that's not what I see in the log. In /var/log/maillog, I see:

maillog.1: Apr 10:08:28 serverfoo sendmail[12345]: r5ND75SPa012345: from=, size=1345, class 0, nrcpts=1, msgid=, proto=ESMTP, daemon=MTA, relay=mail.senderfoo.com []

maillog.1: Apr 10:08:49 serverfoo sendmail[12500]: r5ND75SPa012345: to=, delay:00:00:21, xdelay=00:00:21 mailer=esmtp, pri=157967, relay=backup2.recipientfoo.com. [], dsn=4.0.0, stat=Deferred: Connection timed out with backup2.recipientfoo.com.

maillog.1: Apr 10:17:14 serverfoo sendmail[23455]: r5ND75SPa012345: to=, delay:00:08:46, xdelay=00:00:00 mailer=esmtp, pri=153398, relay=backup2.recipientfoo.com. [], dsn=4.0.0, stat=Deferred: Connection timed out with backup2.recipientfoo.com.

maillog.1: Apr 11:18:21 serverfoo sendmail[1246]: r5ND75SPa012345: to=, delay:01:09:53, xdelay=00:00:00 mailer=esmtp, pri=151198, relay=backup2.recipientfoo.com. [], dsn=4.0.0, stat=Deferred: Connection timed out with backup2.recipientfoo.com.

maillog.1: Apr 12:17:00 serverfoo sendmail[12560]: r5ND75SPa012345: to=, delay:02:08:32, xdelay=00:00:00 mailer=esmtp, pri=322498, relay=mail.cloudfoo.com. [], dsn=2.0.0, stat=sent ( [InternalId=123456789] Queued mail for delivery)

(details have been edited to protect the innocent)

According to DNS records, it should have tried mail.cloudfoo.com first... but I don't see it mentioned in the logs. How can I confirm what specific MX priorities SendMail saw when delivering a message?

Update 2

As a test, I intentionally blocked firewall access for a lab server and tried sending a message to a test account on yahoo.

Check it out:

[root@foobox ~]# mailq
                /var/spool/mqueue (2 requests)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
r3O3cqEm011098    51218 Tue Apr 23 20:38 MAILER-DAEMON
                 (Deferred: Connection refused by alt4.gmail-smtp-in.l.google.)
r3NMd1Em011926    48807 Tue Apr 23 15:39 <footestuser@gmail.com>
                 (Deferred: Connection refused by mta5.am0.yahoodns.net.)
                Total requests: 2

[root@foobox ~]# sendmail -v -d17.9 -qR@yahoo.com

Running /var/spool/mqueue/r3NMd1Em011926 (sequence 1 of 1)
mxrand(mta6.am0.yahoodns.net) = 20
mxrand(mta7.am0.yahoodns.net) = 89
mxrand(mta5.am0.yahoodns.net) = 140
hostsignature(): getmxrr() returned 3, mxhosts[0]=mta6.am0.yahoodns.net.
hostsignature(yahoo.com.) = mta6.am0.yahoodns.net.,mta7.am0.yahoodns.net.,mta5.am0.yahoodns.net.
hostsignature(): stab(yahoo.com.) found mta6.am0.yahoodns.net.,mta7.am0.yahoodns.net.,mta5.am0.yahoodns.net.
<footestuser@yahoo.com>... Connecting to mta7.am0.yahoodns.net. via esmtp...
<footestuser@yahoo.com>... Connecting to mta5.am0.yahoodns.net. via esmtp...
<footestuser@yahoo.com>... Connecting to mta6.am0.yahoodns.net. via esmtp...
<footestuser@yahoo.com>... Deferred: Connection refused by mta6.am0.yahoodns.net.

It correctly identifies the MX preference but what I don't understand is why the verbose output shows it connecting to mta7 and mta5 (both of which have a higher MX value). What does that mean?

  • Could you post real doain name of the destination? [It may be caused by some DNS configurations] – AnFi Apr 22 '13 at 22:28
  • 1
    If you stop and restart sendmail, does the described behavior persist? – adamo Apr 23 '13 at 11:15
  • 1
    You may use sendmail -d17.9 -qR@recipientfoo.com to request delivery of queued messages with MX lookups tracking. – AnFi Apr 23 '13 at 19:55
  • 1
    1) Add also -v option to get -dx.x results on the screen: sendmail -v -d17.9 -qR@recipientfoo.com -> look for hostsignature lines 2) Are you sure there has been a message for recipientfoo.com in the Sendmail queue? P.S. A) I use such tricks not too often so I have missed importance of -v. Without it results produced by -d does not show. B) -d17 is correct for tracking MX unlike another value mentioned in the removed comment. – AnFi Apr 24 '13 at 6:11
  • 1
    Ask your "update 2" question at news:comp.mail.sendmail – AnFi Apr 24 '13 at 11:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.