Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I'm trying to configure sendmail on Centos 5 so that all mail goes through another SMTP server. In this case, it happens to be an Exchange Server. I've edited the file with this line:

define(`SMART_HOST', `')dnl

But when I try to send an e-mail, I get the following error:

Nov  2 14:02:00 COMPUTERNAME sendmail[1370]: oA2K1xht001368: to=<>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=120355, relay=, dsn=5.1.2, stat=Host unknown (Name server: host not found)

The box is accessible from the box I am sending mail from. Meaning, I can ping and get good responses. So I don't understand why sendmail can't find the host. Any ideas? Thanks.

share|improve this question
Are you able to telnet to port 25 on the target server from the sendmail host? – Matt Simmons Nov 2 '10 at 20:27
Yes, "telnet 25" works for me and connects fine. I can get a Hello....Oh, just noticed that the Hello I get back says the IP is Is that normal? – user43049 Nov 2 '10 at 20:31
up vote 3 down vote accepted

Sendmail appears to be doing a name lookup on ''. Change the to point to a hostname. If the hostname isn't in DNS you can put it into /etc/hosts.

share|improve this answer
Tried to get in touch with the IT guy to figure out the hostname for that box. But in the meantime I tried embobo's fix and it worked. Thanks for the answer. – user43049 Nov 2 '10 at 20:37

Otherwise you can put the IP address in square brackets: [].

share|improve this answer
That was it. Strange that it doesn't recognize an IP address automatically. Thanks. – user43049 Nov 2 '10 at 20:36
OK, since both answers worked, but jcollie's answer was first and it saves me from having to change the IP address if the Exchange Server gets moved, I'm going to give him the answer. Thanks so much for your help. – user43049 Nov 2 '10 at 20:43

Did you generate a new file after modifying

# m4 /etc/mail/ > /etc/mail/

Also, don't forget to restart the service.

# service sendmail restart

share|improve this answer
Thanks for the answer. Looks like I just needed to find out the hostname, because sendmail was attempting to do a name lookup on the IP address. – user43049 Nov 2 '10 at 20:44
Ahhh, I see that now. I swear the question wasn't solved when I first started looking for the notes I had on this. :) – Aaron Copley Nov 2 '10 at 20:46

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.