From 7b4c8f67eb5f8e3e943d72a78bdeb4194a68c61e Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Wed, 1 May 2024 00:11:40 +0200 Subject: imap: add imaps+insecure mode When connecting through environments bypassing hostnames, like SSH tunnels, the certificate verification of the server will fail, making it impossible to connect, if plain IMAP has been disabled. Add handling for the insecure modifier to the imaps connection. Changelog-added: Add `imaps+insecure` to the available protocols, for connections that should ignore issues with certificate verification. Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- worker/imap/connect.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'worker/imap') diff --git a/worker/imap/connect.go b/worker/imap/connect.go index 6c704d35..01ba7801 100644 --- a/worker/imap/connect.go +++ b/worker/imap/connect.go @@ -57,6 +57,9 @@ func (w *IMAPWorker) connect() (*client.Client, error) { } } case "imaps": + if w.config.insecure { + tlsConfig.InsecureSkipVerify = true + } tlsConn := tls.Client(conn, tlsConfig) c, err = client.New(tlsConn) if err != nil { -- cgit