From 4b5e65d4c2e1e98b72f2b59fcfb1ebc283e353a4 Mon Sep 17 00:00:00 2001 From: Rein Date: Mon, 9 Jan 2023 20:39:43 +0900 Subject: [PATCH] fix(mailer): forcessl config (#60) Co-authored-by: Rein-R3 Reviewed-At: https://github.com/go-vikunja/api/pull/60 --- pkg/mail/mail.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/mail/mail.go b/pkg/mail/mail.go index b1ad3db1d7..4ac2c5ae02 100644 --- a/pkg/mail/mail.go +++ b/pkg/mail/mail.go @@ -58,6 +58,10 @@ func getClient() (*mail.Client, error) { mail.WithTimeout((config.MailerQueueTimeout.GetDuration() + 3) * time.Second), // 3s more for us to close before mail server timeout } + if config.MailerForceSSL.GetBool() { + opts = append(opts, mail.WithSSL()) + } + if config.MailerUsername.GetString() != "" && config.MailerPassword.GetString() != "" { opts = append(opts, mail.WithSMTPAuth(authType)) }