How do I allow my flask application to send emails using GoDaddys SMTP configuration ?
I have read this article https://www.linode.com/community/questions/19082/i-just-created-my-first-linode-and-i-cant-send-emails-why-mailing-ports-25-465-a
Although my case is a bit different, I have setup a flask application with APIs that also trigger an email. My email client is GoDaddy and I have the settings stored in the env file of my flask application. I run the application using gunicorn and nginx. The same application is running as a test site on heroku and emails are being sent fine, while in Linode the application doesnt send the email and I eventually get a timeout error.
What I have tried so far?
- Unblocked the ports 465 and 587, using ufw commands
- Switched on SSL and turned off TLS - and vice versa (using letsencrypt for SSL)
What I am reading ?
Postfix to be used as a email server on linode, but I doubt that is going to work.
Appreciate your help.
3 Replies
✓ Best Answer
Unblocked the ports 465 and 587, using ufw commands
Have you requested Linode support to unblock ports 465, 587 and 25 for your Linode? See: here…
Also, there's nothing magic about using a Linode for an email server. I've done it for years.
-- sw
@clevin --
Switched on SSL and turned off TLS - and vice versa (using letsencrypt for SSL)
You actually want this the other way around… SSL was deprecated in 2011…and is insecure:
https://www.zdnet.com/article/google-reveals-major-flaw-in-outdated-but-widely-used-ssl-protocol/
When you "turn on SSL", what you're turning on is most likely TLS 1.2 or 1.3. Nobody supports any flavor of SSL these days. LetsEncrypt certs ONLY work with TLS.
See: https://en.wikipedia.org/wiki/Transport_Layer_Security#SSL_1.0,_2.0,_and_3.0
The upshot here is that the terms "SSL" and "TLS" are synonymous now…and that "true SSL" (the thing developed by Netscape in the 1990s) died a long time ago. Ports 443 (https), 587 (submission), 465 (smtps), 993 (imaps) & 995 (pop3s) all use TLS.
You really want to take active measures to disallow a client or cooperating server from using SSL as it's most likely an attack. For example, my postfix(1) mail server only accepts TLS connections/traffic using TLS 1.2 or TLS 1.3:
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3 !TLSv1 !TLSv1.1
If I add !SSLv1 to this list, postfix(1) chokes…because SSLv1 is so old I guess…
-- sw