From c52ca6687401639b716155cc90097f190b2739fa Mon Sep 17 00:00:00 2001 From: Igor Almeida Date: Fri, 20 Nov 2015 16:09:14 -0300 Subject: [PATCH] Maildir folder: extract lower-case letters (custom flags) from filename Remove filtering that was previously done to avoid errors in flag handling. Signed-off-by: Igor Almeida Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Maildir.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/offlineimap/folder/Maildir.py b/offlineimap/folder/Maildir.py index a7dbf26..19a9ecf 100644 --- a/offlineimap/folder/Maildir.py +++ b/offlineimap/folder/Maildir.py @@ -135,9 +135,7 @@ class MaildirFolder(BaseFolder): uid = long(uidmatch.group(1)) flagmatch = self.re_flagmatch.search(filename) if flagmatch: - # Filter out all lowercase (custom maildir) flags. We don't - # handle them yet. - flags = set((c for c in flagmatch.group(1) if not c.islower())) + flags = set((c for c in flagmatch.group(1))) return prefix, uid, fmd5, flags def _scanfolder(self, min_date=None, min_uid=None): @@ -149,7 +147,7 @@ class MaildirFolder(BaseFolder): with similar UID's (e.g. the UID was reassigned much later). Maildir flags are: R (replied) S (seen) T (trashed) D (draft) F - (flagged). + (flagged), plus lower-case letters for custom flags. :returns: dict that can be used as self.messagelist. """ @@ -414,8 +412,7 @@ class MaildirFolder(BaseFolder): if flags != self.messagelist[uid]['flags']: # Flags have actually changed, construct new filename Strip - # off existing infostring (possibly discarding small letter - # flags that dovecot uses TODO) + # off existing infostring infomatch = self.re_flagmatch.search(filename) if infomatch: filename = filename[:-len(infomatch.group())] #strip off