Report this

What is the reason for this report?

Email issues - I'm a bit confused

Posted on June 5, 2014

Hello all :) I’ve set up a WordPress site on my droplet (LAMP, Ubuntu 12.04). I’m also using google apps to handle my email. I have my DNS set up to use gmail, as well.

the problem is with the WordPress site. I’ve set up Postfix (and followed this tutorial to relay gmail: http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html) and PHP mail (msmtp) and they seem to be working - especially the PHP mail. All of the tests are coming through just fine. However, I have my google apps email address set as the admin in my WordPress environment, and I have a contact form that’s set to send notifications to that address. I also have the form (uses Gravity Forms) to email a copy of the filled-out form to whatever end user filled it out.

None of those emails are coming through anywhere. It’s like WordPress isn’t connected to any sort of mail setup at all. I tried using a WordPress SMTP plugin, but that also fails with a message:

SMTP -> ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)

There’s a few of my tests that are showing up in my /var/mail folder, but it appears they are postfix error messages - they all say the"user" doesn’t exist (but I set one up, so it should be there). here’s one of the messages, if it helps:

Diagnostic-Code: X-Postfix; unknown user: “shelly”

So I’m kinda stumped as to what I’m doing wrong here. In all honesty, I don’t want to use my droplet for mail at all, I just want to have Gmail/Google Apps handle it completely. If anyone could point me to whatever I’m doing wrong/missing, I’d really appreciate it.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

My suggestion bypasses postfix completely why not use a Wordpress SMTP plugin with a gmail account you create solely for notifications from your site?

Check postfix’s error logs: <br><pre>tail -30 /var/log/mail.log <br>tail -30 /var/log/mail.err</pre> <br>Do you see any errors in there?

The error it self is clean enough: “Failed to connect to server”. <br>Now, what that means? Your server couldn’t resolve the provided address name. So the question is: why does it work locally? Because your machine knows itself. <br> <br>A working DNS service is a must to properly do name conversion of provided addresses.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.