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

May 1, 2015 1.1k views
Configuration Management Email PHP Ubuntu

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:

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)

Have another answer? Share your knowledge.