Failed to send magic link email Error when trying to sign up

This worked for me. Ironically, I think the order matters here, since I had all the same information as you @mjw but in a different order within the JSON. Once I copied your template into my configuration and edited with the info specific to my Mailgun account, it worked like a charm.

Thank you so much!

1 Like

Sorry to bring up a quasi dead post, but how would you have this added in your docker/docker-compose? I have a bunch of mail_options in my compose file, but it looks like those were ignored when I look at my config.prod.

See this post:

See I have that, but the config.production file just has “Direct” and it gives me a magic link error when someone attempts to subscribe.

Please remember to NOT Reply All when replying to this email.

IIRC, and I don’t use Docker for Ghost, config.production.json isn’t used by Docker; you have to pass the relevant environment variables for your setup.

This is a thread on a public forum, not an email conversation.

Hello, I got exactly the same error but in my case, it’s because I’m using a free account.

In /var/www/my-super-blog-on-top, I ran this command:

journalctl -fu '*ghost*'

Then, I tried to generate a magic link once again and got these logs:

Jan 04 08:45:08 vps-290d48db node[133743]: [2024-01-04 08:45:08] ERROR Failed to send email. Reason: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings..
Jan 04 08:45:08 vps-290d48db node[133743]:
Jan 04 08:45:08 vps-290d48db node[133743]: Failed to send email. Reason: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings..
Jan 04 08:45:08 vps-290d48db node[133743]: "Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
Jan 04 08:45:08 vps-290d48db node[133743]: Error ID:
Jan 04 08:45:08 vps-290d48db node[133743]:     9046afb0-aadd-11ee-96b4-45ad56f06527
Jan 04 08:45:08 vps-290d48db node[133743]: Error Code:
Jan 04 08:45:08 vps-290d48db node[133743]:     EENVELOPE
Jan 04 08:45:08 vps-290d48db node[133743]: ----------------------------------------
Jan 04 08:45:08 vps-290d48db node[133743]: Error: Data command failed: 421 Domain mail.my-super-blog-on-top.com is not allowed to send: Free accounts are for test purposes only. Please upgrade or add the address to authorized recipients in Account Settings.
.
.
.
Jan 04 08:45:08 vps-290d48db node[133743]: [2024-01-04 08:45:08] INFO "POST /members/api/send-magic-link/" 400 404ms

This is pretty explicit. However, it’s sad because I just started my blog and can’t afford the Foundation offer, but that’s another subject.

I hope it helps!

(ps: it’s been 11 months since the last reply was written. I was facing the same error, but not for the same reason that I couldn’t solve for hours. I wanted to share it, sorry if it was not appropriate.)

Edit: I don’t know why but the “reset password” email is still being sent + I found a solution thanks to @jannis !

Have a look here: How to Downgrade to the Flex Plan in Mailgun in 2023

2 Likes

Thank you so much, I also started a self-hosting plan with Digital Ocean and the official guides are not working for the email part.

They should update the docs.

Also I had issues with free RAM (1GB was consuming too rapidly) and hopefully I solved thanks to this amazing forum