feat: allow to run the test suite against underscore-domain relays

Such relays serve self-signed certificates, and are created e.g. by cmlxc deploys.
This commit is contained in:
holger krekel
2026-03-01 23:51:44 +01:00
parent f589ef42ab
commit 5aa4d805aa
4 changed files with 40 additions and 9 deletions

View File

@@ -43,9 +43,14 @@ class DirectImap:
host = user.rsplit("@")[-1]
pw = self.account.get_config("mail_pw")
ssl_context = ssl.create_default_context()
if host.startswith("_"):
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
while True:
try:
self.conn = MailBox(host, port, ssl_context=ssl.create_default_context())
self.conn = MailBox(host, port, ssl_context=ssl_context)
self.conn.login(user, pw)
self.select_folder("INBOX")
return