Issue Summary
- Newsletter subscription emails won’t get delivered with custom SMTP server set up in config file. No trace of error on UI or in Ghost logs.
- Ghost user notification emails will get delivered as expected (with from email address as set up in config file) –> this shows that the SMTP config is correct.
- A related issue may be this: The from address on the confirmation email for updating email in Admin Settings (Support/Newsletter) is incorrect · Issue #12802 · TryGhost/Ghost · GitHub (should be fixed).
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