Added more debugging messages to the IMAP flag conversion.
This commit is contained in:
parent
9439e1fa8a
commit
adf6515746
|
@ -866,7 +866,6 @@ def add_status_headers_imap(message, flags):
|
||||||
"""Add Status and X-Status headers to a message from an imap mailbox."""
|
"""Add Status and X-Status headers to a message from an imap mailbox."""
|
||||||
status = ""
|
status = ""
|
||||||
x_status = ""
|
x_status = ""
|
||||||
flags = list(flags) # convert from tuple
|
|
||||||
for flag in flags:
|
for flag in flags:
|
||||||
if flag == "\\Draft": # (draft): the user considers this message a draft
|
if flag == "\\Draft": # (draft): the user considers this message a draft
|
||||||
pass # does this make any sense in mbox?
|
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
|
# As with maildir folders, overwrite Status and X-Status headers
|
||||||
# if they exist.
|
# if they exist.
|
||||||
del message['Status']
|
del message['Status']
|
||||||
|
vprint("converting imap status (%s)..." % " ".join(flags))
|
||||||
if status:
|
if status:
|
||||||
vprint("converting imap status into Status header '%s'" % status)
|
vprint("generating Status header '%s'" % status)
|
||||||
message['Status'] = status
|
message['Status'] = status
|
||||||
|
else:
|
||||||
|
vprint("not generating Status header")
|
||||||
del message['X-Status']
|
del message['X-Status']
|
||||||
if 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
|
message['X-Status'] = x_status
|
||||||
|
else:
|
||||||
|
vprint("not generating X-Status header")
|
||||||
|
|
||||||
def is_flagged(message):
|
def is_flagged(message):
|
||||||
"""return true if the message is flagged important, false otherwise"""
|
"""return true if the message is flagged important, false otherwise"""
|
||||||
|
|
Loading…
Reference in New Issue