If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:
-
What’s your URL? https://www.ewesparky.com/
-
What version of Ghost are you using? 3.3.0
-
What configuration? DigitalOcean pre-configured Ghost droplet
-
What browser? Firefox 71 on Windows 10 1809
-
What errors or information do you see in the console? See below
-
What steps could someone else take to reproduce the issue you’re having?
- Install DigitalOcean droplet
- Configure Mailgun SMTP via Ghost-CLI
- Restart Ghost instance
- Check if HTTP error 500/502 generated
Hi there,
I had previously tried to configure mail using the admin site, but I wanted to use a different domain to my site (email.mydomain… rather than www.mydomain… as shown in Ghost admin). The API would return an error that it failed to send, so I deleted those settings and tried it via Ghost-CLI instead.
I tried to configure mail using Mailgun via SMTP with ghost config
followed by ghost restart
. No error appeared in the terminal, but my site started to return a HTTP error 502.
I checked the https...production.error.log
logfile, which shows the following:
{
"name": "Log",
"hostname": "da-ghost",
"pid": 26088,
"level": 50,
"err": {
"id": "c9abe4c0-36a9-11ea-9162-9b5350eb082d",
"domain": "https://www.ewesparky.com",
"code": null,
"name": "EmailError",
"statusCode": 500,
"level": "normal",
"message": "Failed to send email. Reason: Can't send mail - all recipients were rejected.",
"help": "\"Please see https://ghost.org/docs/concepts/config/#mail for instructions on configuring email.\"",
"stack": "EmailError: Failed to send email. Reason: Can't send mail - all recipients were rejected.\n at EmailError.GhostError (/var/www/ghost/versions/3.2.0/core/server/lib/common/errors.js:10:26)\n at new EmailError (/var/www/ghost/versions/3.2.0/core/server/lib/common/errors.js:34:20)\n at createMailError (/var/www/ghost/versions/3.2.0/core/server/services/mail/GhostMailer.js:50:12)\n at EventEmitter.<anonymous> (/var/www/ghost/versions/3.2.0/core/server/services/mail/GhostMailer.js:116:28)\n at Object.onceWrapper (events.js:286:20)\n at EventEmitter.emit (events.js:198:13)\n at EventEmitter.emit (domain.js:448:20)\n at DirectMailer.<anonymous> (/var/www/ghost/versions/3.2.0/node_modules/directmail/lib/mailer.js:185:42)\n at SMTPClient.<anonymous> (/var/www/ghost/versions/3.2.0/node_modules/directmail/lib/mailer.js:277:9)\n at Object.onceWrapper (events.js:286:20)\n at SMTPClient.emit (events.js:198:13)\n at SMTPClient.EventEmitter.emit (domain.js:448:20)\n at SMTPClient._onError (/var/www/ghost/versions/3.2.0/node_modules/simplesmtp/lib/client.js:373:10)\n at SMTPClient._actionRCPT (/var/www/ghost/versions/3.2.0/node_modules/simplesmtp/lib/client.js:1054:18)\n at SMTPClient._onData (/var/www/ghost/versions/3.2.0/node_modules/simplesmtp/lib/client.js:354:29)\n at Socket.emit (events.js:198:13)\n at Socket.EventEmitter.emit (domain.js:448:20)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)\n at Socket.Readable.push (_stream_readable.js:223:10)\n at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)"
},
"msg": "Failed to send email. Reason: Can't send mail - all recipients were rejected.",
"time": "2020-01-14T08:42:24.914Z",
"v": 0
}
After getting the above error, I tried ghost doctor
:
✔ Checking system Node.js version
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking operating system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_www-ewesparky-com
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
I rebooted, but the error remained. I removed the mail settings from config.production.json
and ran ghost restart
. The site came back online immediately.
Any ideas why configuring mail results in an error 502?
Thanks for your help.