aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolaus Schulz <microschulz@web.de>2007-10-24 02:23:59 +0000
committerNikolaus Schulz <microschulz@web.de>2007-10-24 02:23:59 +0000
commit8e73e315e4a77dbccd8bfa3f1c049e279b581eb1 (patch)
tree3a63876845eda3dbf9e15b592676bba15ab259ed
parentb07a4cfbf30e99f8771f27756b1fb8723e41b1b2 (diff)
downloadarchivemail-8e73e315e4a77dbccd8bfa3f1c049e279b581eb1.tar.gz
archivemail-8e73e315e4a77dbccd8bfa3f1c049e279b581eb1.tar.bz2
archivemail-8e73e315e4a77dbccd8bfa3f1c049e279b581eb1.zip
Skip invalid messages/files in Maildirs.
Closes: #1783369, Debian bug #255944, and Debian bug #305902 also seems about this issue.
-rwxr-xr-xarchivemail.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/archivemail.py b/archivemail.py
index b3f6a00..4822a32 100755
--- a/archivemail.py
+++ b/archivemail.py
@@ -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: