I got a msg from one of my subscribers today about not being able to log into their account because the magic link failed to be sent. I saw this issue before and I figured out it was the mailgun plan I was on. For some reason I was restricted then, and when I got on the basic plan I was golden. Zero issues.
Fast forward to today where out of the blue no one can get access to magic links, I can’t log in by clicking “sign in” like usual. I already looked into ghost manager, and I never changed the json file, so I have no clue what the problem is now. I suspect Mailgun changed their plan features AGAIN and made certain features paywalled at the higher plans. I’m annoyed and I’d like to get this resolved as soon as possible. I sent out a ticket to Mailgun to help fix this situation, but this is what I have as my production.json file, removed sensitive passwords:
I did do a ghost log to see what would pop up, and I did not see any errors. I updated to the most recent version weeks ago and didn’t have an issue updating. Any help would be great!
Where are you hosting? If it’s digital ocean, they’re now blocking most outbound SMTP.
I am hosting on digital ocean! I had no idea they were doing this! How would I even go about fixing this, then? I can only log in through admin, and sending tokens when I impersonate the subscriber isn’t working either.
Ok, so I tried a lot of things today, and one thing that seems to be working is that I changed my port from 587 to 2525 since 25, 465, and 587 are blocked by Digital Ocean.
I used SWAKS to see if it worked
./swaks --auth
–server smtp.mailgun.org:2525
–au postmaster@example.net
–ap ********************************
–to email@example.net
–h-Subject: “Hello”
–body ‘Testing Mailgun’
And it connected! So I confirmed my mailgun settings are correct, and the json isn’t giving any errors in the ghost log. But now i have a new issue. I tested the log in on my website, and now it gives a new error! It says I failed to log in. I’m not sure where to go from here, and I still need magic links to work. Any suggestions?
Here is the ghost log error I saw when I pulled up content/logs.
[2025-04-30 17:13:23] ERROR “POST /members/api/send-magic-link/” 500 538ms
NAME: EmailError
CODE: EAUTH
MESSAGE: Failed to send email. Reason: Invalid login: 535 Authentication failed.
The member was me, but its odd because I use this email to log in so I’m wondering if this will be the case for everyone else who attempts to log in! It doesnt work if I try another account…
+EDIT+
I figured out the issue after tweeking my json again to reflect my password for my account on mailgun when I reset my mail user account. I tried it and can receive magic links to my inbox. If I hadn’t known about the port block, I’d have never delved this deep to figure things out. Digital Ocean does block the normal ports, but not 2525, for those who are having trouble!
1 Like
Glad you got it working! I suspect that DO will probably eventually block 2525 also, so you may want to consider switching to the API instead. Your config file would have something like this.
“mail”: {
“transport”: “mailgun”,
“from”: “me@mydomain.com”,
“options”: {
“auth”: {
“api_key”: “redacted”,
“domain”: “mg.mydomain.com”
},
“host”: “api.mailgun.net”
}
},
1 Like
It’s prudent advice, and I’ll be implementing this ASAP! I don’t want another incident! Would I then add the mailgun private API key in the api_key value instead of the mailgun user and password like I did in my previous config json? I just got things working and now I’m afraid of breaking things! lol I really do appreciate your help!
Yep. Be sure to test after restarting ghost!
1 Like