Centos – Sendmail server keeps relaying mail to wrong server

centosemailemail-serversendmail

Email to my organization (mycompany.com) goes through 2 sendmail servers running on CentOs 5.6, mail01 and mail02. I've configured a new sendmail server, mail03, in a different site for DR purposes, and am now testing it.

I haven't got the public MX records set up to point to the new server yet since that requires some red tape to get through, so I decided to test the new server internally. I started a telnet session from mail02 to mail03 port 25, and typed in the SMTP commands to send an email from gmail to me@mycompany.com. I receive the email, but I noticed that mail03 is relaying the mail to mail01 first, then mail01 delivers it to my internal exchange server. I have the mailertable feature enabled and a entry for mycompany.com that points directly to my exchange server, so I don't know why it would relay the mail somewhere else.

I couldn't find any configuration that would do that, so i thought it must be a DNS issue. Since I do not have the authority to change the public DNS records, I set up a test DNS server that contains an MX record for mycompany.com that points to mail03.

This time, sending a mail gets this error:

Dec 30 03:53:21 mail03 sendmail[1886]: rBU3qVcM001880: SYSERR(root): mail3.mycompany.com. config error: mail loops back to me (MX problem?)

Perhaps there is a setting that tells sendmail that its responsible for a domain or something? I don't remember having this problem when I set up the other 2 servers. Any help would be appreciated.

Best Answer

As it turns out, it had nothing to do with sendmail's configuration. When I edited the resolv.conf file for the new server, I added in the nameserver entry, but did not edit the search domain entry, which was left as 'domain.org'. After changing that to 'mycompany.com', mail started relaying properly.

I don't know why this would make a difference though.