summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-06 14:23:32 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-06 14:23:32 +0200
commitce96bb25f424f88ac3a4843c0c9381eb820649d2 (patch)
tree6fc5c5dc511ee0ce313fc3efaa6915340002de8a /pykolab
parent899fd8ec78ae03907f7a52b6764d25a2ff9b5cdd (diff)
downloadpykolab-ce96bb25f424f88ac3a4843c0c9381eb820649d2.tar.gz
Fix folder name encodin issues in undelete-mailbox (#5299) Additionally, try to properly detect when XFER command should be issued
Summary: Fixes #5299 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D152
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/imap/cyrus.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index cd4191d..63b0615 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -468,18 +468,22 @@ class Cyrus(cyruslib.CYRUS):
)
target_server = self.find_mailfolder_server(target_folder)
+ source_server = self.find_mailfolder_server(undelete_folder)
if hasattr(conf, 'dry_run') and not conf.dry_run:
- if target_server is not self.server:
+ undelete_folder = self.folder_utf7(undelete_folder)
+ target_folder = self.folder_utf7(target_folder)
+
+ if not target_server == source_server:
self.xfer(undelete_folder, target_server)
self.rename(undelete_folder, target_folder)
else:
- if not target_server == self.server:
+ if not target_server == source_server:
print >> sys.stdout, \
_("Would have transferred %s from %s to %s") % (
undelete_folder,
- self.server,
+ source_server,
target_server
)
@@ -589,7 +593,7 @@ class Cyrus(cyruslib.CYRUS):
mbox['domain']
)
- folders = self.lm(deleted_folder_search)
+ folders = self.lm(self.folder_utf7(deleted_folder_search))
# The folders we have found at this stage include virtdomain folders.
#
@@ -606,4 +610,4 @@ class Cyrus(cyruslib.CYRUS):
folders = _folders
- return folders
+ return [self.folder_utf8(x) for x in folders]