Php – Google Apps + PHP mail() problem

emailg-suitePHPsendmail

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!

Best Answer

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.