summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-17 13:58:27 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-01-17 13:58:27 +0100
commit70681e3d0c10b5fa9f043cbc62ea56eb645ab313 (patch)
tree2e820f93d0098322fc8186d1ec0ccf6b0ef969fb /pykolab/imap
parent4829b270a75abd929a8897559bcb1610e847417e (diff)
downloadpykolab-70681e3d0c10b5fa9f043cbc62ea56eb645ab313.tar.gz
Await having created the user mailbox in a cyrus imap murder topology
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index f9c95f1..0f02dae 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -425,6 +425,18 @@ class IMAP(object):
self.create_folder(folder_name, server)
+ # In a Cyrus IMAP Murder topology, wait for the murder to have settled
+ if hasattr(self.imap, 'murder') and self.imap.murder:
+ self.disconnect()
+ self.connect()
+
+ created = False
+ while not created:
+ created = self.has_folder(folder_name)
+ if not created:
+ log.info(_("Waiting for the Cyrus IMAP Murder to settle..."))
+ time.sleep(0.5)
+
if not self.domain == None:
if conf.has_option(self.domain, "autocreate_folders"):
_additional_folders = conf.get_raw(