summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-13 10:48:04 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-13 10:48:18 +0200
commit4b6115a99c658a6f990937b6acbceecc3902d8cd (patch)
tree0205caa802ff8fafb49ba288eab6222f5cbc9bea
parent61eeb5c09b49205cea3913b3f5ad65ac01b0e927 (diff)
downloadpykolab-4b6115a99c658a6f990937b6acbceecc3902d8cd.tar.gz
Fix handling of folder name encoding in list-deleted-mailboxes (#5318)
Summary: Fixes #5318 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Differential Revision: https://git.kolab.org/D153
-rw-r--r--pykolab/cli/cmd_list_deleted_mailboxes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pykolab/cli/cmd_list_deleted_mailboxes.py b/pykolab/cli/cmd_list_deleted_mailboxes.py
index 6506d65..55d90a6 100644
--- a/pykolab/cli/cmd_list_deleted_mailboxes.py
+++ b/pykolab/cli/cmd_list_deleted_mailboxes.py
@@ -70,10 +70,11 @@ def execute(*args, **kw):
print "Deleted folders:"
for folder in folders:
- mbox_parts = imap.parse_mailfolder(folder)
+ utf8_folder = imap_utf7.decode(folder).encode('utf-8')
+ mbox_parts = imap.parse_mailfolder(utf8_folder)
+ ts = datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16))
if not conf.raw:
- print "%s (Deleted at %s)" % (imap_utf7.decode(folder).encode('utf-8'), datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16)))
+ print "%s (Deleted at %s)" % (utf8_folder, ts)
else:
- print "%s (Deleted at %s)" % (folder, datetime.datetime.fromtimestamp(int(mbox_parts['hex_timestamp'], 16)))
-
+ print "%s (Deleted at %s)" % (folder, ts)