From ab02f656be5fd10bc062ba7a59deb7aea515a1d9 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Thu, 29 Apr 2021 18:19:41 +0200 Subject: [PATCH] add ServerName to TLS config --- internal/common/email.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/common/email.go b/internal/common/email.go index 37578fb..bb35449 100644 --- a/internal/common/email.go +++ b/internal/common/email.go @@ -67,7 +67,7 @@ func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body, ht default: // MailEncryptionNone srv.Encryption = mail.EncryptionNone } - srv.TLSConfig = &tls.Config{InsecureSkipVerify: !cfg.CertValidation} + srv.TLSConfig = &tls.Config{ServerName: srv.Host, InsecureSkipVerify: !cfg.CertValidation} switch cfg.AuthType { case MailAuthPlain: srv.Authentication = mail.AuthPlain