oplusc
By:
oplusc

Droplet running WP and Exim won't email local FQDN

November 25, 2014 1k views

I am running a Droplet with Ubuntu 14.04, WordPress and Exim for email.

I have setup Exim to be able to receive email notifications from WordPress and everything appears to be working fine as long as I use an email address that is NOT on the FQDN.

In other words, if my site is example.com, I can receive emails with no problem as long as those email are sent to name@gmail.com or name@anyotherdomain.com but, if I try to send to name@example.com, the message doesn't get delivered.

This issue not only happens from within WordPress, but also from the command line.

If I enter echo "This is a test." | mail -s Testing name@example.com the email does not get delivered, however if I try echo "This is a test." | mail -s Testing name@gmail.com the message gets delivered without a glitch.

I can send email from any email client to name@example.com without any problem so, evidently, it is something related to the configuration on my droplet.

Any help with this will be much appreciated.

2 Answers

If you droplet is named example.com on DO and you are hosting email accounts for your site example.com on another service/server like Google Apps or another server you need to set your hosts file to the external ip address of your domain "example.com". not sure on ubuntu but is usually in /etc/hosts.

If your droplet is named example.com and your email account are hosted in the same droplet then modify hosts file to point example.com to 127.0.0.1

Thanks for the reply.

I'm not sure I'm following.

My email account is indeed hosted on another service like Google Apps.

Currently I have my hosts file set as follow:

127.0.0.1       localhost.localdomain localhost
127.0.1.1       example.com example
my.external.ip.address   example.com example

my.external.ip.address being the IP address that resolves to my site (assigned by DO)

So, how should I modify my hosts file to make this work, considering that the external IP address for example.com is already listed in the file?

Have another answer? Share your knowledge.