diff --git a/radicale/auth/imap.py b/radicale/auth/imap.py index 3fdbaa70..18af91d1 100644 --- a/radicale/auth/imap.py +++ b/radicale/auth/imap.py @@ -59,7 +59,10 @@ class Auth(auth.BaseAuth): if self._security == "starttls": connection.starttls(ssl.create_default_context()) try: - connection.login(login, password) + connection.authenticate( + "PLAIN", + lambda _: "{0}\x00{0}\x00{1}".format(login, password).encode(), + ) except imaplib.IMAP4.error as e: logger.warning("IMAP authentication failed for user %r: %s", login, e, exc_info=False) return ""