learn to not download UIDs defined by the user
Allow users to workaround offending emails that offlineimap can't download. Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
@ -45,6 +45,7 @@ class BaseFolder(object):
|
||||
if self.name == 'INBOX':
|
||||
self.newmail_hook = repository.newmail_hook
|
||||
self.have_newmail = False
|
||||
self.copy_ignoreUIDs = None # List of UIDs to ignore.
|
||||
self.repository = repository
|
||||
self.visiblename = repository.nametrans(name)
|
||||
# In case the visiblename becomes '.' or '/' (top-level) we use
|
||||
@ -870,6 +871,13 @@ class BaseFolder(object):
|
||||
if not statusfolder.uidexists(uid)]
|
||||
num_to_copy = len(copylist)
|
||||
|
||||
# Honor 'copy_ignore_eval' configuration option.
|
||||
if self.copy_ignoreUIDs is not None:
|
||||
for uid in self.copy_ignoreUIDs:
|
||||
if uid in copylist:
|
||||
copylist.remove(uid)
|
||||
self.ui.ignorecopyingmessage(uid, self, dstfolder)
|
||||
|
||||
if num_to_copy > 0 and self.repository.account.dryrun:
|
||||
self.ui.info(
|
||||
"[DRYRUN] Copy {0} messages from {1}[{2}] to {3}".format(
|
||||
|
Reference in New Issue
Block a user