/offlineimap/head: changeset 287

Alter handling of messages flagged for deletion -- no longer
automatically delete them if expunge is 0. In Maildir folder, we will
now ignore the T flag entirely, and just pass it back and forth with
IMAP.
This commit is contained in:
jgoerzen 2002-11-12 22:40:40 +01:00
parent 61b6c32d0f
commit 872d960fa8
2 changed files with 4 additions and 14 deletions

View File

@ -89,9 +89,7 @@ class IMAPFolder(BaseFolder):
else: else:
uid = long(options['UID']) uid = long(options['UID'])
flags = imaputil.flagsimap2maildir(options['FLAGS']) flags = imaputil.flagsimap2maildir(options['FLAGS'])
# Skip messages already flagged for deletion on the server. self.messagelist[uid] = {'uid': uid, 'flags': flags}
if not 'T' in flags:
self.messagelist[uid] = {'uid': uid, 'flags': flags}
def getmessagelist(self): def getmessagelist(self):
return self.messagelist return self.messagelist

View File

@ -116,17 +116,9 @@ class MaildirFolder(BaseFolder):
if flagmatch: if flagmatch:
flags = [x for x in flagmatch.group(1)] flags = [x for x in flagmatch.group(1)]
flags.sort() flags.sort()
if 'T' in flags: retval[uid] = {'uid': uid,
# Message is marked for deletion; just delete it now. 'flags': flags,
# Otherwise, the T flag will be propogated to the IMAP 'filename': file}
# server, and then expunged there, and then deleted here.
# Might as well just delete it now, to help make things
# more robust.
os.unlink(file)
else:
retval[uid] = {'uid': uid,
'flags': flags,
'filename': file}
return retval return retval
def cachemessagelist(self): def cachemessagelist(self):