From 7b408b0c5843c4ccbd079d5f787e462cbd0c3f01 Mon Sep 17 00:00:00 2001 From: Hubert Pineault Date: Sun, 20 Mar 2022 11:36:01 -0400 Subject: [PATCH] Allow filtering of folders with spaces This patch adds support to filter folders with the space caracter. When the folder includes spaces, the folder name must be quoted. This commit is basicaly a copy-paste of commit 81bd57e4 Signed-off-by: Hubert Pineault --- offlineimap/repository/IMAP.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py index 5b29b21..d834db1 100644 --- a/offlineimap/repository/IMAP.py +++ b/offlineimap/repository/IMAP.py @@ -717,6 +717,9 @@ class IMAPRepository(BaseRepository): try: for foldername in self.folderincludes: try: + # Folder names with spaces requires quotes + if ' ' in foldername: + foldername = '"' + foldername + '"' imapobj.select(imaputil.utf8_IMAP(foldername), readonly=True) except OfflineImapError as exc: