sendmail refuses to use smart host
Posted on 2010-08-27
I have a problem with the way sendmail sends messages. By default, it uses email@example.com which fails with some on the outside because of the dns lookup.
I was able to get the masquerade working so it sends as firstname.lastname@example.org but fails for local users. If a local user on domain.com was the recipient, sendmail tries to deliver locally, fails because of no local account, and generates an NDR.
I decided to use exchange for smart host. In my test environment, I added the lines in sendmail.cf to use smarthost. I used m4 to create then restarted sendmail. I tested to my hotmail account and was successful. Then I tested to my domain.com account and was delivered. In the message headers it showed that Exchange received it from the linux box.
Here is where the problem comes in. When I do this on my production box, the masquerade works, but will NOT use smart host. It keeps trying to deliver locally and fails with NDR. I have done a couple times, even copying the sendmail.cf from the test machine. Yet after using m4 to regenerate and restarting sendmail it refuses to use smart host and is treating like a local account, refusing delivery for domain.com recipients.
Both systems are CentOS 5.5 with the same sendmail packages, on the same network, on the same switch with no firewall between each other or Exchange. Both resolve DNS properly when I do host -t mx domain.com so I can't make sense as to why the same sendmail configuration works on one system and not the other.