6

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.

user43049
  • 163
  • 1
  • 1
  • 4

3 Answers3

4

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

Mark Wagner
  • 18,019
  • 2
  • 32
  • 47
  • That was it. Strange that it doesn't recognize an IP address automatically. Thanks. – user43049 Nov 02 '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 02 '10 at 20:43
3

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.

jcollie
  • 627
  • 5
  • 7
  • 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 02 '10 at 20:37
2

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

Aaron Copley
  • 12,525
  • 5
  • 47
  • 68
  • 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 02 '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 02 '10 at 20:46