Can't send emails -- Mailgun

I am using the latest version of Ghost (3.23.1). I have my UFW firewall disabled. I have verified that I can send email using Swaks (using Port 2525) and that Port 2525 is open.

My issue is that when I go to login or subscribe and enter an email, the button just spins forever. I am not seeing anything in the logs except Cookie ghost-members-ssr not found. No emails are being sent.

I’m on Linode and the standard ports are blocked so I have it set up to use Port 2525. Here is my mail config.

“mail”: {
“transport”: “SMTP”,
“options”: {
“service”: “Mailgun”,
“host”: “smtp.mailgun.org”,
“port”: 2525,
“auth”: {
“user”: “postmaster@mg.XXXXX.com”,
“pass”: “XXXXX”
}
}
},

Thanks a million.

Are you forcing a secure connection?

Yes, I have tried it both with and without ```
“secureConnection”: true,

Ok, I got it to actually send staff emails by removing these lines:

    "service": "Mailgun",

and

    “secureConnection”: true,

It still won’t send subscribe or login emails. I’m using the Lyra theme if that matters.

Ok, further research and experimentation shows that it will send the message when SSL is not set up. Once SSL is set up, it won’t send the subscribe emails and it just spins.

I’m in the same situation as you. Hosting on Linode and have done the same testing with the same results. I really want to use Ghost but it’s looking unusable unless this email problem is resolved. If you find a solution please post back.

Tell me your specific issue and I can help.

“mail”: {
“transport”: “SMTP”,
“options”: {
“host”: “smtp.mailgun.org”,
“port”: 2525,
“secureConnection”: true,
“auth”: {
“user”: “postmaster@XXXXX.com”,
“pass”: “XXXXX”
}
}
},

The code above works for Linode. Notice that it uses Port 2525. It uses that Port because Linode has the other ones blocked.

If you let me know the specific issue, I can probably help with it. I spent too long fixing my own. :)

1 Like

Thanks, this set me on the right track to solve my problem. Port 2525 was needed to send emails out from a Linode server.

After that sending an email resulted in the following error

Error sending email! Error sending email: Failed to send email. Reason: 140261834299264:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:…/deps/openssl/openssl/ssl/record/ssl3_record.c:332: . Please check your email settings and resend the invitation.

After some digging I found the following link explaining the problem

The problem is that when you use secureConnection=1 the mail system (in node.js?) seems to try to connect using SSLv3.
SSLv3 is a deprecated protocol that thats some vulnerabilities and is exposed to POODLE attack.
So nginx.conf is usually configured to disble SSLv3 protocol and thus the error.

Instead of configuring nginx to use SSLv3 and opening up my server to a vulnerability, I just changed secureConnection to false instead of secure.

The follow link explains why that works.

Thanks for the reply. It pushed me in the right direction. I never thought that Linode would block the default port.

1 Like