Newsletter subscription email not delivering (due to domain mismatch in from email address)

Issue Summary

Analysis and workaround

  • It turns out (after inspecting the SMTP logs – outside Ghost) that for the newsletter subscription Ghost is using a from address in the form of noreply @ subdomain . domain . com (where subdomain . domain . com is the site of the Ghost installation) and not noreply @ domain . com as configured in the config file. Note that Ghost is using noreply @ domain . com for user notification emails as expected.
  • The reason why the email will not be delivered is because the recipient’s server bounces it back if there are no SPF/DKIM records set (why would be).
  • So, an obvious workaround is to set a SPF and/or DKIM records for subdomain . domain . com.
  • (Sorry for the spaces in the email address example, the forum didn’t allow me to post otherwise ;)

Steps to Reproduce

See above.


Setup information

Ghost Version
5.81.1

Node.js Version
v18.19.0

How did you install Ghost?
Via How to install & setup Ghost on Ubuntu 20.04 or 22.04

Provide details of your host & operating system
Ubuntu 22.04.3 LTS

Database type
MySQL 8.0.36-0ubuntu0.22.04.1

Do you have your mail.from set in your config file, as listed? The behavior is supposed to be fixed as of 5.78, but I wonder if you’re missing a config file setting…?

Hi Cathy,

yes, mail.from is set. This is how our mail config looks like (see below).

And yes, I know it was supposed to be fixed, but it’s a bit different behaviour too (compared to what was reported back then). Here, it’s about Ghost altering the email address (by adding a subdomain) wrt the data entered in the config file.

Best,

Peter

“mail”: {
“transport”: “SMTP”,
“from”: “noreply@yourdomain.com”,
“options”: {
“host”: “mail.youremaildomain.com”,
“port”: 465,
“auth”: {
“user”: “youruser”,
“pass”: “yourpass”
}
}

Is Ghost running on a subdomain?

Yes, for testing and prepping the production deployment.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.