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.
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.
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.
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:
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 04:38 AM.|