How to set up a web server with the same domain name as my gmail?

Posted May 1, 2015 4.4k views
UbuntuPHPEmailConfiguration Management

My web server has the domain,, and my team and I have set up email through google with the same domain. When I try to send email using php’s mail method to an email address it doesn’t get successfully sent. How can I configure my server/php to not handle email with the same domain name?

If I didn’t explain it well I’m having the issue described here:

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

Does it work if you send emails to another domain? If so, what MTA do you use?

  • After making calls via the command line I’ve found the difference below in the relay and status parts of the log. I assume the problem is because the server has the domain and I’m trying to send an email to an address even though that’s hosted at google the server still tries to handle it.

    Failed:, relay=none, delay=0.04, delays=0.02/0.01/0/0.01, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to[private/dovecot-lmtp]: No such file or directory)

    Successful:,[]:25, delay=0.6, delays=0.02/0.01/0.19/0.39, dsn=2.0.0, status=sent (250 2.0.0 OK 1430967219 s9si739729qct.40 - gsmtp)