Email issues - I'm a bit confused

  • Posted on June 5, 2014
  • shellyAsked by shelly

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: 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.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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

I apologize for not coming back to this until now. david294611’s answer was what I did - and it’s working great.

I’m getting ready to add in 2-factor authentication to be sure it still works with that, but so far, I haven’t needed anything but gmail and the SMTP plugin (I’m using this one, if it helps anyone in the future: and all is working perfectly well. Exactly what I wanted.

For the record, the errors in the log files were “unknown user”, even though the user is definitely there. @Alexandre, the “failed to connect to server” was a message from the SMTP plugin, not the error logs. My DNS is fine. I can even send test emails from the command line and they come through - it’s just via WordPress that they don’t.