Skip to content
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

Merged
merged 3 commits into from
Sep 24, 2024
Merged

Mua: support 465 port connections #4606

merged 3 commits into from
Sep 24, 2024

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Sep 23, 2024

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 same gen_tcp vs ssl configuration in gen_smtp. I think we can maybe come up with a better name later on.

Related: #4584

@ruslandoga ruslandoga requested a review from a team September 23, 2024 13:07
@ruslandoga ruslandoga mentioned this pull request Sep 23, 2024
4 tasks
@@ -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)
Copy link
Contributor Author

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
Copy link
Contributor Author

@ruslandoga ruslandoga Sep 23, 2024

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.

@zoldar zoldar added the preview label Sep 24, 2024
Copy link

Preview environment👷🏼‍♀️🏗️
PR-4606

@ruslandoga ruslandoga added this pull request to the merge queue Sep 24, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 24, 2024
@ruslandoga ruslandoga added this pull request to the merge queue Sep 24, 2024
Merged via the queue into master with commit 09c74ee Sep 24, 2024
12 checks passed
@ruslandoga ruslandoga deleted the mua-support-465 branch September 27, 2024 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants