Mailgun SMTP stopped working on Docker

I wonder what’s going on after updating to Ghost 6 because my e-mails stopped working on Mailgun SMTP.

That’s my .env file:

mail__options__host=smtp.mailgun.org
mail__options__auth__api_key=MYAPIKEY
mail__options__auth__pass=MYPASS
mail__options__port=587
mail__options__secure=false
mail__options__from=me@mydomain.tld
mail__options__auth__user=postmaster@mydomain.tld
mail__options__requireTLS=true
mail__options__service=Mailgun
mail__from=me@mydomain.tld
mail__options__domain=mydomain.tld
mail__transport=Mailgun

Ghost container logs shows Failed to send email. Please check your site configuration and try again.

Alredy tried changing the port to 465, disabling requireTLS and updating the variable mail__options__secure on true.

How to debug and what’s can be wrong?

I’d start by asking where you’re hosting. Hosting providers are notorious for blocking outbound SMTP as an anti-spam strategy.

Wait… hang on. You appear to have a mixture of the API settings and the SMTP settings.

Mailgun credential setting (SMTP route, susceptible to hosting provider blocks) are here:

And here’s the API version (won’t be blocked by your host)

I’d pick one method (preferably API-based), confirm values for that method, strip out the unneeded bits, and see if that resolves it. If it doesn’t, check your Ghost logs and your Mailgun logs.

1 Like

Thanks Cathy, I was using the service without any issue before upgrading to Ghost 6 on Docker. And I’m using it with Discourse as well.

So, if I’m self-hosting the best approach is to continue using config.json file rather than variables?

Do you know if I can debug more? The Ghost log is very superficial at this and I need to fix it. SMTP is better for me than API.

I have .env variables set for SMTP only and have my Mailgun API configured via Ghost Settings after booting the container.
I believe this is the same thing @Cathy_Sarisky is suggesting.
With docker, you don’t touch the configuration json yourself at all.

Sorry Satonotdead - I could have been clearer. I was linking config.json so that you could see the values needed, with translation for docker, not saying you should switch.

So what specifically do you see in the ghost log, and in mailgun’s logs?