summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-04 19:41:09 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-08-04 19:46:28 (GMT)
commit84fd219265a9c589d5031e9476677c0a3f59bab4 (patch)
tree7e03812bbb7689d8ee96d232aaf2fd59ff20b348
parent49acbe0b394d91c7fe7f6bd92513efcbb544978c (diff)
downloadpykolab-84fd219265a9c589d5031e9476677c0a3f59bab4.tar.gz
Rename folders correctly
-rw-r--r--pykolab/imap/cyrus.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index f09e429..6f561ce 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -123,6 +123,7 @@ class Cyrus(cyruslib.CYRUS):
imap = IMAP()
imap.connect(uri=uri)
+
if not self.SEP == self.separator:
self.separator = self.SEP
@@ -236,8 +237,12 @@ class Cyrus(cyruslib.CYRUS):
server = self.find_mailfolder_server(from_mailfolder)
self.connect(self.uri.replace(self.server,server))
- log.debug(_("Moving INBOX folder %s to %s") % (from_mailfolder,to_mailfolder), level=8)
- self.m.rename(from_mailfolder, to_mailfolder, partition)
+ if not partition == None:
+ log.debug(_("Moving INBOX folder %s to %s on partition %s") % (from_mailfolder,to_mailfolder, partition), level=8)
+ else:
+ log.debug(_("Moving INBOX folder %s to %s") % (from_mailfolder,to_mailfolder), level=8)
+
+ self.m.rename(self.folder_utf7(from_mailfolder), self.folder_utf7(to_mailfolder), '"%s"' % (partition))
def _getannotation(self, *args, **kw):
return self.getannotation(*args, **kw)