Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

When I send emails using PHP's mail() function from my web app I can deliver e-mails successfully to any e-mail address except to my own Google Apps e-mail account, which happens to be on the same domain the web app is on.

I've read http://www.google.com/support/a/bin/answer.py?hl=en&answer=55299 which seems to be my problem, but I don't understand what it's telling me to do. I've also looked at http://forums.cpanel.net/f43/google-apps-mail-problem-139337.html but I'm not sure if that's specific to cpanel or not.

I'm on a VPS with Ubuntu 8.04 Hardy Herron.

Any help would be appreciated, thanks!

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Most MTAs (mail servers) will not lookup MX records if the local server has email setup for the domain, they will instead deliver locally. Turn off email locally for this domain (or I believe there might be a setting in cpanel to force DNS lookups) and your emails should start working.

share|improve this answer
    
Do you know how to do this through the shell? I don't have cpanel :-( Thanks –  user29403 Aug 9 '10 at 15:56
    
which mailserver are you using? Likely to be either postfix, qmail or exim –  James Lawrie Aug 9 '10 at 15:59
    
I'm using sendmail –  user29403 Aug 9 '10 at 16:06
    
go into each file that grep -R -l "the_email_hostname" /var/mail/* returns and delete the entry for the hostname. –  James Lawrie Aug 9 '10 at 16:14
    
Hmm, there;s nothing in /var/mail but a file called www-data which appears to be a log of delivered e-mails –  user29403 Aug 9 '10 at 16:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.