fix: enforce TLS 1.2 minimum version in IMAP and SMTP connections (#742)

Daniel Purnomo created

Change summary

fetcher/fetcher.go | 1 +
sender/sender.go   | 2 ++
2 files changed, 3 insertions(+)

Detailed changes

fetcher/fetcher.go 🔗

@@ -264,6 +264,7 @@ func connectWithOptions(account *config.Account, extraOpts *imapclient.Options)
 		TLSConfig: &tls.Config{
 			ServerName:         imapServer,
 			InsecureSkipVerify: account.Insecure,
+			MinVersion:         tls.VersionTLS12,
 		},
 	}
 	if extraOpts != nil {

sender/sender.go 🔗

@@ -637,6 +637,7 @@ func SendEmail(account *config.Account, to, cc, bcc []string, subject, plainBody
 	tlsConfig := &tls.Config{
 		ServerName:         smtpServer,
 		InsecureSkipVerify: account.Insecure,
+		MinVersion:         tls.VersionTLS12,
 	}
 
 	var c *smtp.Client
@@ -834,6 +835,7 @@ func SendCalendarReply(account *config.Account, to []string, subject, plainBody
 	tlsConfig := &tls.Config{
 		ServerName:         smtpServer,
 		InsecureSkipVerify: account.Insecure,
+		MinVersion:         tls.VersionTLS12,
 	}
 
 	var c *smtp.Client