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
This commit is contained in:
Rodolfo García Peñas (kix) 2021-10-11 22:54:54 +02:00
parent 88e318fab1
commit ea4b0438fe

View File

@ -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)