From 29cd73aa46b4417c63f1ebf09ce048bd3e7cc379 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 22 Mar 2021 22:53:59 +0100 Subject: [PATCH] fix TLS for email sending --- internal/common/email.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/common/email.go b/internal/common/email.go index e25da1d..b4bbd59 100644 --- a/internal/common/email.go +++ b/internal/common/email.go @@ -71,9 +71,9 @@ func SendEmailWithAttachments(cfg MailConfig, sender, replyTo, subject, body str } } - if cfg.CertValidation { - return e.Send(hostname, auth) + if cfg.TLS { + return e.SendWithStartTLS(hostname, auth, &tls.Config{InsecureSkipVerify: !cfg.CertValidation}) } else { - return e.SendWithStartTLS(hostname, auth, &tls.Config{InsecureSkipVerify: true}) + return e.Send(hostname, auth) } }