7

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=<[email protected]>, ctladdr=<[email protected]> (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.

3
  • Are you able to telnet to port 25 on the target server from the sendmail host? Nov 2, 2010 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, 2010 at 20:31
  • Use msmtp instead. May 13, 2021 at 9:34

3 Answers 3

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.

1
  • 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, 2010 at 20:37
4

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

2
  • That was it. Strange that it doesn't recognize an IP address automatically. Thanks.
    – user43049
    Nov 2, 2010 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, 2010 at 20:43
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

2
  • 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, 2010 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. :) Nov 2, 2010 at 20:46

You must log in to answer this question.

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