summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-27 13:29:57 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-27 13:29:57 +0100
commiteef4fcb4a64c29a9c1c5fb670f8a5a6a813591b3 (patch)
treea37253ce5a46a4aa5220d61d896086b160ea77fb /pykolab/imap
parent647634e70b04f7c624bd0cfdea755b294d029f8c (diff)
downloadpykolab-eef4fcb4a64c29a9c1c5fb670f8a5a6a813591b3.tar.gz
Add an option to specify the partition on which a mailbox is to be created
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 0f02dae..9995292 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -207,7 +207,7 @@ class IMAP(object):
else:
log.warning(_("Called imap.disconnect() on a server that we had no connection to."))
- def create_folder(self, folder_path, server=None):
+ def create_folder(self, folder_path, server=None, partition=None):
folder_path = self.folder_utf7(folder_path)
if not server == None:
@@ -215,7 +215,7 @@ class IMAP(object):
self.connect(server=server)
try:
- self._imap[server].cm(folder_path)
+ self._imap[server].cm(folder_path, partition=partition)
return True
except:
log.error(
@@ -228,7 +228,7 @@ class IMAP(object):
else:
try:
- self.imap.cm(folder_path)
+ self.imap.cm(folder_path, partition=partition)
return True
except:
log.error(_("Could not create folder %r") % (folder_path))
@@ -617,6 +617,13 @@ class IMAP(object):
additional_folders[additional_folder]['quota']
)
+ if additional_folders[additional_folder].has_key("partition"):
+ partition = additional_folders[additional_folder]["partition"]
+ try:
+ self.imap.rename(folder_name, folder_name, partition)
+ except:
+ log.error(_("Could not rename %s to reside on partition %s") % (folder_name, partition))
+
def user_mailbox_delete(self, mailbox_base_name):
"""
Delete a user mailbox.