Sending emails via my own Postfix server via SSL/TLS

I haven’t found any example. Neither have I been able to even authenticate using the library Swooth .

Is there any example? Has anyone done that?

my own Postfix server, SSL/TLS

# config/config.exs
config :sample, Sample.Mailer,
  adapter: Swoosh.Adapters.SMTP,
  relay: "smtp.avengers.com",
  username: "tonystark",
  password: "ilovepepperpotts",
  ssl: true,
  tls: :always,
  auth: :always,
  port: 1025,
  dkim: [
    s: "default", d: "domain.com",
    private_key: {:pem_plain, File.read!("priv/keys/domain.private")}
  ],
  retries: 2,
  no_mx_lookups: false

Have you tried not using the ssl: true flag? It might override the port setting and force it to 465.

No, because on my postfix ssl is mandatory

Like I said, it might fix the port to 465, so give it a try.

Just consider also other mail servers that also support REST API like Postal.
We use this as an alternative to Sendgrid. (side by side)

It’s closed on the server

I think we’re talking past each other. If you set ssl: true, gen_smtp sets the port to 465. If you want to use TLS on port 1025, you have to remove ssl: true.

I just tried with my own postfix server. With ssl: true, :gen_smtp returns

{:error, :retries_exceeded,
 {:network_failure, 'my.mail.server',
  {:error, {:tls_alert, 'bad record mac'}}}}

With ssl: false, the mailing is sucessful:

"2.0.0 Ok: queued as E11D9140608\r\n"

This is the second time we’ve had to ask you not to be rude, so I’m suspending your account until next week and locking the thread for a while - if you want help from the community, please treat our members with the respect and courtesy they deserve.

If on your return you cannot be respectful we will unfortunately have no choice but to close your account.

For reference, here is my previous response to you:

This topic was automatically opened after 5 days.