Fix missing tls config

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-03-12 15:02:08 +01:00
parent 3e0c748fc9
commit 9a7da091fa

View File

@@ -17,6 +17,7 @@ package mailer
import (
"bytes"
"context"
"crypto/tls"
"errors"
"fmt"
"net"
@@ -92,7 +93,7 @@ func (m *Mailer) sendMailWithTimeout(ctx context.Context, to []string, msg []byt
defer c.Quit()
if m.cfg.TLSRequired {
if err := c.StartTLS(nil); err != nil {
if err := c.StartTLS(&tls.Config{ServerName: host}); err != nil {
return fmt.Errorf("TLS negotiation error: %w", err)
}
}