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

SMTP adapter is broken in Docker image #1009

Open
taobojlen opened this issue Jul 10, 2022 · 0 comments
Open

SMTP adapter is broken in Docker image #1009

taobojlen opened this issue Jul 10, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@taobojlen
Copy link

Describe the bug
When self-hosting Papercups with docker compose, the SMTP mailer is broken.

To Reproduce
Steps to reproduce the behavior:

  1. Open iex
  2. import Swoosh.Email
  3. Try to send an email like new() |> from("noreply@support.example.com") |> to("myself@example.com") |> subject("Hi there") |> text_body("Testing SMTP integration") |> ChatApi.Mailers.deliver(). You will see the following error:
** (ArgumentError) argument error
    :erlang.split_binary('250-smtp.ohmysmtp.com Nice to meet you, static.106.78.235.167.clients.your-server.de\r\n', 3)
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/binstr.erl:114: :binstr.substr/3
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:697: :gen_smtp_client.read_possible_multiline_reply/1
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:562: :gen_smtp_client.try_EHLO/2
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:623: :gen_smtp_client.do_STARTTLS/2
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:594: :gen_smtp_client.try_STARTTLS/3
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:333: :gen_smtp_client.open_smtp_session/2
    (gen_smtp 0.15.0) /app/deps/gen_smtp/src/gen_smtp_client.erl:271: :gen_smtp_client.try_smtp_sessions/3

Expected behavior
Sending the email works.

Additional context
I believe this is caused by this bug: gen-smtp/gen_smtp#250

If that's the case, using a more recent version of Elixir/OTP in the Docker image would fix it, as would updating gen_smtp.

@taobojlen taobojlen added the bug Something isn't working label Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant