/offlineimap/head: changeset 286
Added ability to disable expunging on the server.
This commit is contained in:
parent
f7c4889918
commit
61b6c32d0f
@ -1,3 +1,9 @@
|
||||
offlineimap (3.99.5) unstable; urgency=low
|
||||
|
||||
* Added ability to disable expunging on the server.
|
||||
|
||||
-- John Goerzen <jgoerzen@complete.org> Tue, 12 Nov 2002 09:29:31 -0600
|
||||
|
||||
offlineimap (3.99.4) unstable; urgency=low
|
||||
|
||||
* Fixed setup.py installation instructions.
|
||||
|
@ -317,3 +317,12 @@ holdconnectionopen = no
|
||||
# set it to "/".
|
||||
|
||||
sep = .
|
||||
|
||||
# Normally, OfflineIMAP will expunge deleted messages from the server.
|
||||
# You can disable that if you wish. This means that OfflineIMAP will
|
||||
# mark them deleted on the server, but not actually delete them.
|
||||
# You must use some other IMAP client to delete them if you use this
|
||||
# setting; otherwise, the messgaes will just pile up there forever.
|
||||
# Therefore, this setting is definately NOT recommended.
|
||||
#
|
||||
# expunge = no
|
||||
|
@ -26,6 +26,10 @@ from copy import copy
|
||||
|
||||
class IMAPFolder(BaseFolder):
|
||||
def __init__(self, imapserver, name, visiblename, accountname, repository):
|
||||
self.config = imapserver.config
|
||||
self.expunge = 1
|
||||
if self.config.has_option(accountname, 'expunge'):
|
||||
self.expunge = self.config.getboolean(accountname, 'expunge')
|
||||
self.name = imaputil.dequote(name)
|
||||
self.root = None # imapserver.root
|
||||
self.sep = imapserver.delim
|
||||
@ -85,7 +89,9 @@ class IMAPFolder(BaseFolder):
|
||||
else:
|
||||
uid = long(options['UID'])
|
||||
flags = imaputil.flagsimap2maildir(options['FLAGS'])
|
||||
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
||||
# Skip messages already flagged for deletion on the server.
|
||||
if not 'T' in flags:
|
||||
self.messagelist[uid] = {'uid': uid, 'flags': flags}
|
||||
|
||||
def getmessagelist(self):
|
||||
return self.messagelist
|
||||
@ -249,7 +255,8 @@ class IMAPFolder(BaseFolder):
|
||||
except imapobj.readonly:
|
||||
UIBase.getglobalui().deletereadonly(self, uidlist)
|
||||
return
|
||||
assert(imapobj.expunge()[0] == 'OK')
|
||||
if self.expunge:
|
||||
assert(imapobj.expunge()[0] == 'OK')
|
||||
finally:
|
||||
self.imapserver.releaseconnection(imapobj)
|
||||
for uid in uidlist:
|
||||
|
Loading…
Reference in New Issue
Block a user