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

sendmail is timing out on one of our CentOS servers. Here is my test

[root@testserver ~]# echo "Subject: test" | /usr/lib/sendmail -v

Here is the output: Connecting to [] via relay...
220 ESMTP Sendmail 8.13.8/8.13.8; Thu, 23 Jun 2011 14:32:18 -0600
>>> EHLO Hello localhost.localdomain [], pleased to meet you
250 HELP
>>> MAIL From:<> SIZE=14
250 2.1.0 <>... Sender ok
>>> RCPT To:<>
>>> DATA
250 2.1.5 <>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 p5NKWInQ008636 Message accepted for delivery Sent (p5NKWInQ008636 Message accepted for delivery)
Closing connection to []
>>> QUIT
221 2.0.0 closing connection

And then a minute later, /var/log/maillog shows the following:

Jun 23 14:32:18 testserver sendmail[8635]: p5NKWICR008635:, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30014, relay=[] [], dsn=2.0.0, stat=Sent (p5NKWInQ008636 Message accepted for delivery)
Jun 23 14:33:00 testserver sendmail[8638]: p5NKWInQ008636: to=<>, ctladdr=<> (0/0), delay=00:00:42, xdelay=00:00:42, mailer=esmtp, pri=120313, [173.201.XXX.XXX], dsn=4.0.0, stat=Deferred: Connection timed out with

In that second log entry, it appears to be trying to use our external company website to try to relay the email... I have no idea why its trying to do that. Another it guy setup this server recently so I'm not sure if he changed the sendmail configuration or what. Where should I be looking to remedy this?

(obviously names, domain names and IP addresses have been changed in the above logs to protect the innocent)

share|improve this question

Sending a mail message externally on a host using sendmail is now a two step process. The first step basically sends the email locally for queueing to be sent externally. The next step in the process takes the queued message and sends it out to the appropriate place. If no destination routing information or smarthost information is configured, sendmail consults the DNS finding the MX records for that domain and uses one of the possibly many hostnames returned to send the mail to. This all looks normal to me, especially if the external MX host is not accessible to you.

Do you want this host to send mail externally, or just forward it to a central location? If all you want to do is the latter, a sendmail configuration file can be generated such that all email sent from your host is forwarded to another host for transmission. This is usually necessary in large companies, like mine, to restrict users from possibly bombing the net with bogus email due to virus.

share|improve this answer
I just want the server to be able to send mail to any email address. Simple as that. We use Google Apps for our company email system. I just want the server to be able to send an email to someone in the Google Apps system. Like Other servers on the network are able to do this without having to forward the mail to some SMTP server or something. Where do I need to go to set this server up like that? – Jake Wilson Jun 23 '11 at 21:19
I'd probably contact the administator of a server that works fine. Get their file (I'll assume that you have the sendmail-devel package loaded). Tweek the file to your local specs...and then use m4 to generate a new file. (Usually m4 >/etc/ and restart sendmail. – mdpc Jun 23 '11 at 22:57

Check if you can connect to (host specified as relay= in log) with telnet to port 25 (telnet 173.201.XXX.XXX 25). If you unable to do so then you have firewall or routing problem with connectivity to relay server and you should investigate it further with ping/traceroute.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.