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 <igor.contato@gmail.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Igor Almeida 2015-11-20 16:09:14 -03:00 committed by Nicolas Sebrecht
parent 86a91f28c0
commit c52ca66874

View File

@ -135,9 +135,7 @@ class MaildirFolder(BaseFolder):
uid = long(uidmatch.group(1)) uid = long(uidmatch.group(1))
flagmatch = self.re_flagmatch.search(filename) flagmatch = self.re_flagmatch.search(filename)
if flagmatch: if flagmatch:
# Filter out all lowercase (custom maildir) flags. We don't flags = set((c for c in flagmatch.group(1)))
# handle them yet.
flags = set((c for c in flagmatch.group(1) if not c.islower()))
return prefix, uid, fmd5, flags return prefix, uid, fmd5, flags
def _scanfolder(self, min_date=None, min_uid=None): 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). with similar UID's (e.g. the UID was reassigned much later).
Maildir flags are: R (replied) S (seen) T (trashed) D (draft) F 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. :returns: dict that can be used as self.messagelist.
""" """
@ -414,8 +412,7 @@ class MaildirFolder(BaseFolder):
if flags != self.messagelist[uid]['flags']: if flags != self.messagelist[uid]['flags']:
# Flags have actually changed, construct new filename Strip # Flags have actually changed, construct new filename Strip
# off existing infostring (possibly discarding small letter # off existing infostring
# flags that dovecot uses TODO)
infomatch = self.re_flagmatch.search(filename) infomatch = self.re_flagmatch.search(filename)
if infomatch: if infomatch:
filename = filename[:-len(infomatch.group())] #strip off filename = filename[:-len(infomatch.group())] #strip off