Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

Example:      MX preference = 10      MX preference = 20      MX preference = 30

In this case, I would expect to see the an initial attempt to 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, []

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

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

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

maillog.1: Apr 12:17:00 serverfoo sendmail[12560]: r5ND75SPa012345: to=, delay:02:08:32, xdelay=00:00:00 mailer=esmtp, pri=322498, [], 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 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
r3NMd1Em011926    48807 Tue Apr 23 15:39 <>
                 (Deferred: Connection refused by
                Total requests: 2

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

Running /var/spool/mqueue/r3NMd1Em011926 (sequence 1 of 1)
mxrand( = 20
mxrand( = 89
mxrand( = 140
hostsignature(): getmxrr() returned 3, mxhosts[0]
hostsignature( =,,
hostsignature(): stab( found,,
<>... Connecting to via esmtp...
<>... Connecting to via esmtp...
<>... Connecting to via esmtp...
<>... Deferred: Connection refused by

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?

share|improve this question
Could you post real doain name of the destination? [It may be caused by some DNS configurations] – Andrzej A. Filip Apr 22 '13 at 22:28
If you stop and restart sendmail, does the described behavior persist? – adamo Apr 23 '13 at 11:15
You may use sendmail -d17.9 to request delivery of queued messages with MX lookups tracking. – Andrzej A. Filip Apr 23 '13 at 19:55
1) Add also -v option to get -dx.x results on the screen: sendmail -v -d17.9 -> look for hostsignature lines 2) Are you sure there has been a message for 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. – Andrzej A. Filip Apr 24 '13 at 6:11
Ask your "update 2" question at news:comp.mail.sendmail – Andrzej A. Filip Apr 24 '13 at 11:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.