LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Sendmail problem (mail hosted elsewhere) (http://www.linuxquestions.org/questions/linux-server-73/sendmail-problem-mail-hosted-elsewhere-617137/)

60s TV Batman 01-29-2008 09:04 AM

Sendmail problem (mail hosted elsewhere)
 
I have a web server set up for a domain (let's call it mydomain.com). Email for this domain is hosted elsewhere, and run by a 3rd party (who control the DNS and MX records for this domain). It all works just fine.

On the web server, I have a PHP script that uses mail() to send out email in specific situations. This all works just fine, except when the script is sending email to another @mydomain.com email address (i.e. email hosted externally, but carries same mydomin.com domain as used on the web server).

In this case, I get the email returned with a 5.1.1 error (no such email account).

Of course, the email address does exist, just not on the machine I'm sending from. It appears that Sendmail is only looking locally for the to address, instead of looking up the MX record remotely and attempting to send.

NOTE: This only happens when sending to an @mydomain.com. Email to other domains work just fine.

This appears to be a sendmail configuration error. Anybody have any suggestions (or the solution) for this problem?

The system is running Fedora Core 7. Sendmail version is sendmail-8.13.7.

centauricw 01-29-2008 09:04 PM

If your web server is setup as host.mydomain.com, then Sendmail will try to deliver the mail locally. It checks the hostname of the local machine before even trying DNS, and if the domain matches the recipient address, local delivery. You may need to add an entry to mailertable for mydomain.com that points to the offsite email server.

60s TV Batman 01-30-2008 01:13 AM

Quote:

Originally Posted by centauricw (Post 3039490)
If your web server is setup as host.mydomain.com, then Sendmail will try to deliver the mail locally. It checks the hostname of the local machine before even trying DNS, and if the domain matches the recipient address, local delivery. You may need to add an entry to mailertable for mydomain.com that points to the offsite email server.

Thanks centauricw

While looking at mailertable (which is empty on the machine in question), I decided to take a look in the local-host-names file. There is indeed an entry for the domain in question.

I removed the entry, restarted Sendmail, and hey presto! No failed delivery notice.

I can't check the destination myself, so will have to wait until they start work later this morning. I suspect it has done the trick (explains the symptoms).

Thanks for your help.

centauricw 01-31-2008 06:52 AM

You can always do the address processing tests using the "sendmail -bt" command. To see how it will handle a particular address use this command:

3,0 someone@example.com

Sendmail will output the checks it uses processing the address against the sendmail.cf config file and will show that will either be delivered locally or relayed to another system. I use this a lot to resolve Sendmail config issues.


All times are GMT -5. The time now is 03:18 PM.