mirror of
https://github.com/chatmail/core.git
synced 2026-08-13 04:42:05 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user