-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mua: support 465 port connections #4606
Conversation
@@ -641,8 +641,21 @@ case mailer_adapter do | |||
config :plausible, Plausible.Mailer, ssl: [middlebox_comp_mode: middlebox_comp_mode] | |||
|
|||
if relay = get_var_from_path_or_env(config_dir, "SMTP_HOST_ADDR") do | |||
port = get_int_from_path_or_env(config_dir, "SMTP_HOST_PORT", 25) | |||
config :plausible, Plausible.Mailer, relay: relay, port: port | |||
port = get_int_from_path_or_env(config_dir, "SMTP_HOST_PORT", 587) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also changing default here to port=587 since that's what relays listen on usually.
cond do | ||
ssl_enabled -> :ssl | ||
is_nil(ssl_enabled) and port == 465 -> :ssl | ||
true -> :tcp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SMTP_HOST_SSL_ENABLED=false
and SMTP_HOST_PORT=465
would still start connections in plaintext and then optimistically STARTTLS.
|
This PR adds support for SMTPS connections and also makes Mua use SMTPS when relay port is 465.
I am using
SMTP_HOST_SSL_ENABLED
environment variable for now since it's already being used for the samegen_tcp
vsssl
configuration ingen_smtp
. I think we can maybe come up with a better name later on.Related: #4584