[PATCH v2 6/6] Maildir folder: extract lower-case letters (custom flags) from filename

Igor Almeida igor.contato at gmail.com
Fri Nov 20 19:09:14 GMT 2015


Remove filtering that was previously done to avoid errors in flag
handling.

Signed-off-by: Igor Almeida <igor.contato at gmail.com>
---
 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
-- 
2.5.3





More information about the OfflineIMAP-project mailing list