From dce5604f0695e9660d34c5992247c481ac416e2b Mon Sep 17 00:00:00 2001 From: axoroll7 <42817400+axoroll7@users.noreply.github.com> Date: Sun, 27 Aug 2023 17:51:47 +0200 Subject: [PATCH] Removed SPECIAL-USE capability check To comply with RFC 6154. Only the extended LIST command need SPECIAL-USE, not the non-extended LIST command (section 2.0, first paragraph). --- imapclient/imapclient.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/imapclient/imapclient.py b/imapclient/imapclient.py index b62121f3..c39f0421 100644 --- a/imapclient/imapclient.py +++ b/imapclient/imapclient.py @@ -757,10 +757,9 @@ def find_special_folder(self, folder_flag): """ # Detect folder by looking for known attributes # TODO: avoid listing all folders by using extended LIST (RFC6154) - if self.has_capability("SPECIAL-USE"): - for folder in self.list_folders(): - if folder and len(folder[0]) > 0 and folder_flag in folder[0]: - return folder[2] + for folder in self.list_folders(): + if folder and len(folder[0]) > 0 and folder_flag in folder[0]: + return folder[2] # Detect folder by looking for common names # We only look for folders in the "personal" namespace of the user