From 74b799b56f7e2313d0550bc14e63d85c2e20d479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Fri, 15 Oct 2021 23:07:28 +0100 Subject: [PATCH 1/3] Use AUTHENTICATE PLAIN instead of LOGIN Makes imaplib use more modern AUTHENTICATE verb rather than LOGIN. The immediate benefit is that now the credentials can be non-ASCII. In the future, it may be used to add other authentication methods, such as OAuth. References: * https://datatracker.ietf.org/doc/html/rfc6855.html#page-5 * https://bugs.python.org/issue13700 --- radicale_imap/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/radicale_imap/__init__.py b/radicale_imap/__init__.py index f916cbb..4f21bdf 100644 --- a/radicale_imap/__init__.py +++ b/radicale_imap/__init__.py @@ -71,7 +71,10 @@ def login(self, login, password): if 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.debug( "IMAP authentication failed: %s", e, exc_info=True) From a77799c2dd6a65f372c8eba969d08005ffab653d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Thu, 6 Mar 2025 13:15:49 +0000 Subject: [PATCH 2/3] Deprecation warning --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 115970c..1255104 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ -# ⛔️ DEPRECATED +# ⛔️ (Almost) DEPRECATED This feature has been integrated into Radicale as of version 3.4.1. +The PR to add AUTHENTICATE PLAIN has not, so use this with Radicale 3.4.0 if needed. + # Radicale IMAP IMAP authentication plugin for [Radicale](http://radicale.org/). From d18bca852eeb278fa74e78b4f88084524ce370cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Buczkowski?= Date: Thu, 6 Mar 2025 18:19:20 +0000 Subject: [PATCH 3/3] Final depreciation notice --- README.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1255104..e251ed5 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# ⛔️ (Almost) DEPRECATED +# ⛔️ DEPRECATED -This feature has been integrated into Radicale as of version 3.4.1. +RadicaleIMAP has been integrated into Radicale as of version 3.4.1. -The PR to add AUTHENTICATE PLAIN has not, so use this with Radicale 3.4.0 if needed. +This fork was created to support UTF-8 in IMAP authentication, and +the commit for that was merged to Radicale 3.5.0. + +So this repo here is of use to you only if you need Radicale version +3.4.0 or less. It will conflict with Radicale 3.4.1. # Radicale IMAP