Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 sendmail.mc file with this line:

define(`SMART_HOST', `10.1.1.30')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=<testemail@test.com>, ctladdr=<root@localhost.localdomain> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=120355, relay=10.1.1.30, dsn=5.1.2, stat=Host unknown (Name server: 10.1.1.30: host not found)

The box 10.1.1.30 is accessible from the box I am sending mail from. Meaning, I can ping 10.1.1.30 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 10.1.1.30 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 10.1.1.106. Is that normal? –  user43049 Nov 2 '10 at 20:31

3 Answers 3

up vote 2 down vote accepted

Sendmail appears to be doing a name lookup on '10.1.1.30'. Change the sendmail.mc 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: [10.1.1.30].

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 sendmail.cf file after modifying sendmail.mc?

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

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

 
discard

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.