Skip invalid messages/files in Maildirs.

Closes: #1783369, Debian bug #255944, and Debian bug #305902 also seems about
        this issue.
This commit is contained in:
Nikolaus Schulz 2007-10-24 02:23:59 +00:00
parent b07a4cfbf3
commit 8e73e315e4
1 changed files with 4 additions and 3 deletions

View File

@ -1264,8 +1264,10 @@ def _archive_dir(mailbox_name, final_archive_name, type):
cache = IdentityCache(mailbox_name)
msg = original.next()
while (msg):
for msg in original:
if not msg:
vprint("ignoring invalid message '%s'" % get_filename(msg))
continue
msg_size = sizeof_message(msg)
stats.another_message(msg_size)
vprint("processing message '%s'" % msg.get('Message-ID'))
@ -1286,7 +1288,6 @@ def _archive_dir(mailbox_name, final_archive_name, type):
if not options.dry_run: delete_queue.append(get_filename(msg))
else:
vprint("decision: retain message")
msg = original.next()
vprint("finished reading messages")
if not options.dry_run:
if archive: