#25 archivemail needs to preserve IMAP dummy message

closed-fixed
nobody
None
6
2010-08-09
2008-10-30
tlhackque
No

archivemail will happily delete the dummy message that IMAP servers place in mbox files to keep track of the next UID. This isn't the end of the world, but it is mildly unpleasant.

This simple patch will preserve this message. (A more rigorous implemention might ensure that this is the first message in the file.)

Enjoy,

--tlhackque at nospam.yahoo.com

--- /usr/share/archivemail/archivemail.py~ 2007-06-14 11:57:39.000000000 -0400
+++ /usr/share/archivemail/archivemail.py 2008-10-30 18:23:16.000000000 -0400
@@ -981,20 +981,25 @@
# I could probably do this in one if statement, but then I wouldn't
# understand it.
if not old:
return 0
if not options.include_flagged and is_flagged(message):
return 0
if options.min_size and is_smaller(message, options.min_size):
return 0
if options.preserve_unread and is_unread(message):
return 0
+ """TL: Do not remove IMAP header message"""
+ imaphdr = message.get('X-IMAP')
+ if imaphdr :
+ vprint("Message is an IMAP mailbox header ('%s')" % imaphdr)
+ return 0
return 1

def is_older_than_time(time_message, max_time):
"""Return true if a message is older than the specified time,
false otherwise.

Arguments:
time_message -- the delivery date of the message measured in seconds
since the epoch

Discussion

  • tlhackque
    tlhackque
    2008-10-30

    • priority: 5 --> 6
    • summary: archivemail needs to preserver IMAP dummy message --> archivemail needs to preserve IMAP dummy message
     
  • Feature implemented in archivemail 0.8.0.

     
    • status: open --> closed-fixed