How to configure sendmail to use a different SMTP server?

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.


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.


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