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

Network failure / socket closed error after upgrading to OTP26 #329

Open
zambal opened this issue Jul 12, 2023 · 3 comments
Open

Network failure / socket closed error after upgrading to OTP26 #329

zambal opened this issue Jul 12, 2023 · 3 comments

Comments

@zambal
Copy link
Contributor

zambal commented Jul 12, 2023

Describe the bug

We use gen_smtp for sending emails, currently using postmark SMTP servers. After upgrading to OTP26.0.2, sending e-mails fails with this error:

send email error: :retries_exceeded {:network_failure, ~c"52.208.184.61", {:error, :closed}}

These options are used:

[ relay: "smtp.postmarkapp.com" username: "...", password: "...", port: 587, ]

Platform

OTP: 26.0.2
Elixir: 1.15.2
@seriyps
Copy link
Collaborator

seriyps commented Jul 12, 2023

It's not enough information to suggest anything. Can you at least try to enable "tracing" and add here the output?

In Erlang you do it by providing trace_fun option:

gen_smtp_client:send(Email, [{trace_fun, fun io:format/2}, {relay, ...}])

@mworrell
Copy link
Collaborator

If it is since OTP 26 then I suspect a duplicate of #328

@zambal
Copy link
Contributor Author

zambal commented Jul 12, 2023

Sorry for the short description and lacking information, I was a bit in a hurry.

I just tried sending an email with the trace option enabled and although the resulting error tuple is different, it turned out to be the same issue as #328 indeed.

After setting

[{tls_options, [{verify, verify_none}]}]

or

  Opts = [
    {verify, verify_peer},
    {cacerts, certifi:cacerts()},
    {depth, 99},
    {server_name_indication, "smtp.postmarkapp.com"}
  ]
  [{tls_options, Opts}]

all works well again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants