feat(outbound): TLS, STARTTLS and SMTP AUTH towards an external relay

- Add relay TLS modes: none (default), starttls (required, never downgraded) and implicit tls
- Verify the certificate (system roots, optional CA pool and server name), TLS 1.2 minimum
- Add AUTH PLAIN, refused over a clear connection to a remote relay
- Report a wrong password or a relay that wants authentication as a temporary error, so mail waits instead of failing for good
- Add a configurable EHLO name, validated against line breaks
- Arm the context watcher before EHLO so a silent relay cannot hang a send
This commit is contained in:
tgiachi 2026-11-10 11:03:43 +01:00
commit 5dadf46dc8

2
go.mod
View file

@ -5,6 +5,7 @@ go 1.27.3
require (
github.com/emersion/go-message v0.18.2
github.com/emersion/go-msgauth v0.7.0
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6
github.com/emersion/go-smtp v0.25.1
gopkg.in/yaml.v3 v3.0.1
modernc.org/sqlite v1.62.0
@ -12,7 +13,6 @@ require (
require (
github.com/dustin/go-humanize v1.1.0 // indirect
github.com/emersion/go-sasl v0.0.0-20241020182733-b788ff22d5a6 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/ncruces/go-strftime v1.1.0 // indirect