From adf6515746be0882f08a4c1be1aa183111dc2eb1 Mon Sep 17 00:00:00 2001 From: Nikolaus Schulz Date: Wed, 7 Nov 2007 23:51:41 +0000 Subject: [PATCH] Added more debugging messages to the IMAP flag conversion. --- archivemail.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/archivemail.py b/archivemail.py index 6970c35..2e73ff9 100755 --- a/archivemail.py +++ b/archivemail.py @@ -866,7 +866,6 @@ def add_status_headers_imap(message, flags): """Add Status and X-Status headers to a message from an imap mailbox.""" status = "" x_status = "" - flags = list(flags) # convert from tuple for flag in flags: if flag == "\\Draft": # (draft): the user considers this message a draft pass # does this make any sense in mbox? @@ -886,13 +885,18 @@ def add_status_headers_imap(message, flags): # As with maildir folders, overwrite Status and X-Status headers # if they exist. del message['Status'] + vprint("converting imap status (%s)..." % " ".join(flags)) if status: - vprint("converting imap status into Status header '%s'" % status) + vprint("generating Status header '%s'" % status) message['Status'] = status + else: + vprint("not generating Status header") del message['X-Status'] if x_status: - vprint("converting imap status into X-Status header '%s'" % x_status) + vprint("generating X-Status header '%s'" % x_status) message['X-Status'] = x_status + else: + vprint("not generating X-Status header") def is_flagged(message): """return true if the message is flagged important, false otherwise"""