summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-04 14:36:06 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-07-04 14:36:06 +0100
commit2b483d09d7301d35c92e5f87b5032d4d513bc44e (patch)
treee0d0d44ff823a1520931a9a4f254a54fe516d3a0 /pykolab
parent2db7807b78fb46155736d344b3fa429ade90ff82 (diff)
downloadpykolab-2b483d09d7301d35c92e5f87b5032d4d513bc44e.tar.gz
Do not call a delete we do not have,
For an undelete, first transfer to the target server of the target folder, if any other then the default
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/imap/cyrus.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index a3b1199..a40d31d 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -76,9 +76,6 @@ class Cyrus(cyruslib.CYRUS):
# Placeholder for known mailboxes on known servers
self.mbox = {}
- def __del__(self):
- cyruslib.CYRUS.__del__(self)
-
def login(self, *args, **kw):
"""
Login to the Cyrus IMAP server through cyruslib.CYRUS, but set our
@@ -217,6 +214,7 @@ class Cyrus(cyruslib.CYRUS):
if not to_mailbox == None:
target_folder = "%s%s%s" %(target_folder,self.seperator,mbox)
+
if not len(undelete_mbox['path_parts']) == 0:
target_folder = "%s%s%s" %(target_folder,self.seperator,self.seperator.join(undelete_mbox['path_parts']))
@@ -229,6 +227,12 @@ class Cyrus(cyruslib.CYRUS):
target_folder = "%s@%s" %(target_folder,target_mbox['domain'])
log.info(_("Undeleting %s to %s") %(undelete_folder,target_folder))
+
+ target_server = self.find_mailbox_server(target_folder)
+
+ if not target_server == self.server:
+ self.xfer(undelete_folder,target_server)
+
self.rename(undelete_folder,target_folder)
def parse_mailbox(self, mailbox):