summaryrefslogtreecommitdiffstats
path: root/pykolab
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:05 +0200
commit72c1f96b255dfe05cdebc3daa712540b3a1d6909 (patch)
treed53ea2593ed499c6285c45d90047ea82d8ab4860 /pykolab
parented7a476d6b8e18e1eadcb8d120e6636b0fb97de8 (diff)
downloadpykolab-72c1f96b255dfe05cdebc3daa712540b3a1d6909.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
Diffstat (limited to 'pykolab')
-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)