Question

Questions to sendmail with wordpress

Hello, I have the 10$ Wordpress droplet. I had to reinstall sendmail and I cannot make it work again.

Problem: registration/pwd change/whatever that sends mail in WP hangs. Emails are delivered but the website hangs which makes users click the send button 10 million times.

Done so far:

  • followed the tutorial on DO to set up sendmail
  • got fully qualified domain name “droplet.example.com
  • set up the FQDN in /etc/hosts and /etc/hostname and as droplet name
  • made A records for that FQDN
  • made lines for internal and external IPs in /etc/hosts
  • set up masquerading in sendmail.mc
  • removed all lines featuring 127.0.0.1 in sendmail.mc and making sure they are removed from sendmail.cf too

After each change I restarted the sendmail service of course.

No effects so far.

My questions:

  • how come emails sent through wordpress are not logged in /var/log/mail.log ? Where does WP keep mail logs?
  • how come emails sent through wordpress are not in $ mailq even though they obviously hang at least 5 minutes?
  • did I forget something with that sendmail configuration?
Show comments

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.

Utilizing sendmail can be quite tricky on a droplet. To troubleshoot this further, you would want to review the output from a command utilizing the PHP mail function, such as:

php -r 'mail("TO_ADDRESS", "Testing PHP script", "Testing sending email via PHP", "From: YOUR_EMAIL\r\nReply-To: YOUR_EMAIL\r\nX-Mailer: PHP".phpversion());' && tail /var/log/mail.log

You would want to make sure to replace the TO_ADDRESS and YOUR_EMAIL parts with legitimate emails.

The output from such a command would show any PHP issues, as well as the logs the droplet for the mail service (in this case sendmail). If it is working locally, you would then want to inspect your scripts settings. If trying to send email via a remote service, like gmail, you would need to try and see if the remote mail service can provide you some feedback on the reason the issues are occurring.

Hope it helps!

Jason C. DigitalOcean Platform Support Lead