SSL/TLS for port 465 (Net::ReadTimeout) - undocumented solution

I was trying to setup email with a cpanel server. I failed for several hours.
This did the trick in app.yml:

DISCOURSE_SMTP_FORCE_TLS: true

As a new admin, I wonder about this setting:

DISCOURSE_SMTP_ENABLE_START_TLS: true

What is the difference? Why does one work and the other does not? And if that is so: Why would the DISCOURSE_SMTP_FORCE_TLS not be there, too?

It looks like Thunderbird (E-Mail client) shows these three options: no encryption, STARTTLS and SSL/TLS. So, I wondered if DISCOURSE_SMTP_FORCE_TLS implies SSL/TLS, if that could be in the template. Or maybe not?

How is it with documenting these options? Would that be alright? Is there a policy of “keeping templates small”?
E.g. I was a bit confused by DISCOURSE_SMTP_ADDRESS and DISCOURSE_SMTP_DOMAIN as e.g. the curl to send emails does not need DISCOURSE_SMTP_DOMAIN as a parameter.

1 Like

There are two ways of doing SSL with SMTP.

  1. Connect normally, usually over port 25 or 587, and issue a STARTTLS command. This is what DISCOURSE_SMTP_ENABLE_START_TLS is for.
  2. Connect with SSL from the start, usually over port 465. This is what DISCOURSE_SMTP_FORCE_TLS is for.
3 Likes