mirego / accent

The first developer-oriented translation tool. True asynchronous flow between translators and your team.
https://www.accent.reviews
BSD 3-Clause "New" or "Revised" License
1.3k stars 97 forks source link

Failure when sending email with SMTP #391

Closed jone closed 10 months ago

jone commented 1 year ago

Hi there 👋

I tried configuring accent to send emails through an SMTP server with STARTTLS on port 587. I have configured correctly

SMTP_ADDRESS=smtp.hostname.tld
SMTP_PORT=587
MAILER_FROM=foo@domain.tld
SMTP_USERNAME=foo@domain.tld
SMTP_PASSWORD=XXXX

When I trigger an email by inviting somebody, the SMTP connection fails with:

│ 16:20:54.715 [error] Task #PID<0.4655.0> started from #PID<0.4654.0> terminating                                                                                                                        │
│ ** (ArgumentError) raise/1 and reraise/2 expect a module name, string or exception as the first argument, got: {:network_failure, ~c"smtp.hostname.tld", {:error, :closed}}                           │
│     (bamboo 2.2.0) lib/bamboo/strategies/task_supervisor_strategy.ex:25: anonymous fn/3 in Bamboo.TaskSupervisorStrategy.deliver_later/3                                                                │
│     (elixir 1.15.7) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2                                                                                                                            │
│ Function: #Function<0.95237244/0 in Bamboo.TaskSupervisorStrategy.deliver_later/3>                                                                                                                      │
│     Args: []                                                                                                                                                                                            │

On Port 587, there is a STARTTLS SMTP service running. From another container in the same infrastructure the SMTP connection works and the mail is sent correctly with the exact same configuration settings.

How can I solve this problem?

simonprev commented 10 months ago

This has been solved in the latest release with some magic TLS options in Bamboo adapter 😄