From ea4b0438fe97413342b03235c34fe72a0f8cefbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Mon, 11 Oct 2021 22:54:54 +0200 Subject: [PATCH] Support for IMAPv4 ID extension This patch enables the ID extension of IMAPv4. The patch sends the client name and the client version to the server. Usually, the server doesn't require it, but in some cases the server drop de connection if the ID is not send. #Close #71 --- offlineimap/imapserver.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/offlineimap/imapserver.py b/offlineimap/imapserver.py index 0906789..79015a6 100644 --- a/offlineimap/imapserver.py +++ b/offlineimap/imapserver.py @@ -583,6 +583,11 @@ class IMAPServer: af=self.af, ) + # If 'ID' extension is used by the server, we should use it + if 'ID' in imapobj.capabilities: + l_str = '("name" "OfflineIMAP" "version" "{}")'.format(offlineimap.__version__) + imapobj.id(l_str) + if not self.preauth_tunnel: try: self.__authn_helper(imapobj)