0

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

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

Here is the output:

[email protected]... Connecting to [127.0.0.1] via relay...
220 testserver.ourdomain.com ESMTP Sendmail 8.13.8/8.13.8; Thu, 23 Jun 2011 14:32:18 -0600
>>> EHLO testserver.ourdomain.com
250-testserver.ourdomain.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5 CRAM-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<[email protected]> SIZE=14 [email protected]
250 2.1.0 <[email protected]>... Sender ok
>>> RCPT To:<[email protected]>
>>> DATA
250 2.1.5 <[email protected]>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 p5NKWInQ008636 Message accepted for delivery
[email protected]... Sent (p5NKWInQ008636 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 testserver.ourdomain.com closing connection

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

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

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)

2 Answers 2

1

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.

2
  • 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 [email protected]. 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? Jun 23, 2011 at 21:19
  • I'd probably contact the administator of a server that works fine. Get their sendmail.mc 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 sendmail.cf file. (Usually m4 sendmail.mc >/etc/sendmail.cf) and restart sendmail.
    – mdpc
    Jun 23, 2011 at 22:57
1

Check if you can connect to ourdomain.com (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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .