Post comment notification email woes

After having done an upgrade of a very old WordPress install, notification emails were not arriving properly.

Since this installation was originally set up almost two decades ago, back when emails were sent directly from the same hosting server to the MTA. Due to the level of spam this caused, emails nowadays have to be submitted through a proper mail system, not forgetting the fact that port 25 is now blocked at nearly all providers.

I do run some mail servers myself, however I wanted something quick to move on so I decided to use Mailgun which I had an account with already. They actually provide their own Mailgun WordPress plugin so I was up and running as soon as the new DNS records had propagated. Emails started arriving immediately when I updated the Administration Email Address under Settings>General with the new email address. Great stuff!

However I realised that a new comment would no longer trigger the comment notification email. Nothing in the logs of nginx revealed what could be happening. I needed to figure out if the emails were even generated, and if so, where did they get stuck.

Luckily there is another plugin which logs each email sent by WordPress. Once I tested another comment and checked the plugin’s log page in WordPress, I immediately realised what the issue was. It was still being sent to the old administrator email address!

Later I did spot that Mailgun’s own logs actually revealed the same data, but at the time in question I was under the impression that the emails never left WordPress.

Now the mystery… why the heck was WordPress still using the previous email address from Administration Email Address? This field was updated and other admin notification emails were being received just fine.

The issue when dealing with a self-hosted WordPress for oneself is that in the vast majority of cases, one is both the site administrator as well as the only user posting. Apparently the new comment notifications emails are only sent to the post author and not the site administrator. I had simply forgotten about the old email address under the posting user’s profile (Users>Profile)!

Comment moderation emails on the contrary do go to both site administrator and post author.

Do not forget to add or update your Gravatar profile with the new email address.

Comments

One response to “Post comment notification email woes”

  1. Erroneous redirect to login page after commenting as guest – simon.schönbeck.dk avatar

    […] resolving the previous comments issue, I needed to finish off this matter where a guest commenter was wrongfully redirected to the login […]

Leave a Reply

Your email address will not be published. Required fields are marked *