Ghost Members Signup Error

Hi,

Some users are encountering an error on signup from the members magic-link api.

“Failed to load resource: the server responded with a status of 500 ()”

LOGS:
{"name":"Log","hostname":"volta-media-ghost","pid":30113,"level":50,"err":{"id":"eca14560-99af-11ea-9d42-957147131a61","domain":"https://voltamedia.co","code":null,"name":"EmailError","statusCode":500,"level":"normal","message":"Failed to send email.","help":"\"Please see https://ghost.org/docs/concepts/config/#mail for instructions on configuring email.\"","stack":"EmailError: Failed to send email.\n at EmailError.GhostError (/var/www/ghost/versions/3.15.3/node_modules/@tryghost/errors/lib/errors.js:10:26)\n at new EmailError (/var/www/ghost/versions/3.15.3/node_modules/@tryghost/errors/lib/errors.js:34:20)\n at createMailError (/var/www/ghost/versions/3.15.3/core/server/services/mail/GhostMailer.js:51:12)\n at EventEmitter.<anonymous> (/var/www/ghost/versions/3.15.3/core/server/services/mail/GhostMailer.js:112:24)\n at Object.onceWrapper (events.js:417:26)\n at EventEmitter.emit (events.js:310:20)\n at EventEmitter.emit (domain.js:482:12)\n at DirectMailer.<anonymous> (/var/www/ghost/versions/3.15.3/node_modules/directmail/lib/mailer.js:174:38)\n at SMTPClient.<anonymous> (/var/www/ghost/versions/3.15.3/node_modules/directmail/lib/mailer.js:292:13)\n at Object.onceWrapper (events.js:416:28)\n at SMTPClient.emit (events.js:310:20)\n at SMTPClient.EventEmitter.emit (domain.js:482:12)\n at SMTPClient._destroy (/var/www/ghost/versions/3.15.3/node_modules/simplesmtp/lib/client.js:310:10)\n at SMTPClient._onEnd (/var/www/ghost/versions/3.15.3/node_modules/simplesmtp/lib/client.js:410:10)\n at Socket.emit (events.js:322:22)\n at Socket.EventEmitter.emit (domain.js:482:12)\n at endReadableNT (_stream_readable.js:1187:12)\n at processTicksAndRejections (internal/process/task_queues.js:84:21)"},"msg":"Failed to send email.","time":"2020-05-19T09:05:45.658Z","v":0}

The email address they are using is correct.

I have tried manually adding them, but they get an error on sign in as well.

This isn’t happening for everyone though.

The errors seem to be happening for Gmail address, iCloud, Outlook etc, but seems fine for non ESP top level domains.

I am using the Ghost admin integration with MailGun for my email service.

Turns out the secure connection was not working properly in my config: Configuration - Adapt your publication to suit your needs

I tried the standard connection: Configuration - Adapt your publication to suit your needs - and that did not work either.

Ultimately, this fixed my issue:

“mail”: {
  “transport”: “SMTP”,
    “options”: {
    “service”: “Mailgun”,
    “host”: “smtp.eu.mailgun.org”,
    “auth”: {
      “user”: “redacted”,
      “pass”: “redcated”
    }
  },
},
1 Like

This is the solution!
Add the host key with the correct value from mailgunn to your config file.

Someone should update this in the documentation!

This solved my issue, any chance to add the host key to the default here?

Hi all.

Used to use Ghost back in 2015, went away for a long while, but now I’m back!

I’m sorry to revive an old thread, but I’m having this exact issue with 5.14.0 (and on a test server a couple of weeks ago with 5.12.0) and unable to find any other related threads.

On 5.12.0, I thought it was a config issue with Mailgun (as @Izak_Jackson above), but I believe I didn’t have it configured properly so it continued to use the direct mail (nodemailer) service. I did eventually get Mailgun working, so didn’t try direct mail again.

Now I’m testing on another server, and without configuring the SMTP service, emails send to addresses at custom domains, but not icloud.com/me.com, gmail.com, outlook.com

As per @Izak_Jackson: “The errors seem to be happening for Gmail address, iCloud, Outlook etc, but seems fine for non ESP top level domains.”

I suspect this is due to the above providers blocking IP ranges of VPS providers due to spam (in my case, Digital Ocean), but the odd thing is magic links to google workspace custom domains works fine. Not sure why free gmail accounts would have been spam blocking than Workspace.

Not after any help necessarily - I just couldn’t find anything related, so it would be good to get consensus from other Digital Ocean / similar users.

My (eventually) working SMTP Mailgun EU config:

  "mail": {
    "from": "<no-reply@your.domain>",
    "transport": "SMTP",
    "options": {
      "service": "Mailgun",
      "host": "smtp.eu.mailgun.org",
      "port": 587,
      "secure": false,
      "auth": {
        "user": "postmaster@you.your.domain",
        "pass": "mailgun-password"
      }