summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiutauras Adomaitis <adomaitis@kolabsys.com>2018-03-08 12:12:53 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2018-03-08 12:12:54 +0100
commit684ff8c79b9bd2adbcd868258fdba42068d2d910 (patch)
tree2d85db15e5264c67c6d889b61cb6e7bbd0a41a46
parent6cecbcc8e2cfba94cdf26c6d8fb41173be8138de (diff)
downloadpykolab-684ff8c79b9bd2adbcd868258fdba42068d2d910.tar.gz
Fixing the undelete-mailbox in murder topology to a different root folder
Summary: T2307 Test Plan: none Reviewers: vanmeeuwen, machniak Reviewed By: vanmeeuwen Subscribers: machniak, vanmeeuwen Maniphest Tasks: T2307 Differential Revision: https://git.kolab.org/D551
-rw-r--r--pykolab/imap/cyrus.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index 09271fa..1371dff 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -173,8 +173,8 @@ class Cyrus(cyruslib.CYRUS):
_mailfolder = self.parse_mailfolder(mailfolder)
- prefix = _mailfolder['path_parts'].pop(0)
- mbox = _mailfolder['path_parts'].pop(0)
+ prefix = _mailfolder['path_parts'][0]
+ mbox = _mailfolder['path_parts'][1]
if _mailfolder['domain'] is not None:
mailfolder = "%s%s%s@%s" % (
prefix,
@@ -184,8 +184,14 @@ class Cyrus(cyruslib.CYRUS):
)
# TODO: Workaround for undelete
- if len(self.lm(mailfolder)) < 1:
- return self.server
+ if len(self.lm(mailfolder)) < 1 and _mailfolder['hex_timestamp']:
+ mailfolder = self.folder_utf7("DELETED/%s%s%s@%s" % (
+ self.separator.join(_mailfolder['path_parts']),
+ self.separator,
+ _mailfolder['hex_timestamp'],
+ _mailfolder['domain'])
+ )
+
# TODO: Murder capabilities may have been suppressed using Cyrus IMAP
# configuration.
@@ -225,7 +231,7 @@ class Cyrus(cyruslib.CYRUS):
while 1:
num_try += 1
annotations = self._getannotation(
- mailfolder,
+ '"%s"' % (mailfolder),
ann_path
)