LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-29-2008, 09:04 AM   #1
60s TV Batman
Member
 
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60

Rep: Reputation: 17
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.

Last edited by 60s TV Batman; 01-29-2008 at 09:06 AM.
 
Old 01-29-2008, 09:04 PM   #2
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
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.
 
Old 01-30-2008, 01:13 AM   #3
60s TV Batman
Member
 
Registered: Oct 2004
Location: London (UK)
Distribution: Ubuntu 12.04
Posts: 60

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by centauricw View Post
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.

Last edited by 60s TV Batman; 01-30-2008 at 01:18 AM.
 
Old 01-31-2008, 06:52 AM   #4
centauricw
Member
 
Registered: Dec 2005
Location: Lawrenceville GA
Distribution: Slackware, CentOS. Red Hat Enterprise Linux
Posts: 216

Rep: Reputation: 31
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.
 
  


Reply

Tags
configuration, sendmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Mail() Problem w/ Sendmail jusme Linux - Software 6 08-18-2012 02:35 PM
Email question - externally hosted mail server jkmb111 Linux - Software 1 05-17-2005 06:56 PM
Sendmail problem .forward.mail Please HELP kepweng Linux - Software 0 04-16-2004 04:29 AM
mail forwarding problem with sendmail JelloMaster Linux - Software 18 08-14-2003 09:10 AM
Sendmail 8.11.2 Receive mail problem warath Linux - Networking 1 10-20-2001 03:17 PM


All times are GMT -5. The time now is 01:54 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration