summaryrefslogtreecommitdiffstats
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:59:00 +0100
commite8e33406d0bb0373fdbfb31f1e14a8dc93490059 (patch)
treec0a42323583cd19f2497e74f0b0d91944eecb0c7
parent95e0c4347e93dc1730c43a4732cdfbfcf1165cc4 (diff)
downloadpykolab-e8e33406d0bb0373fdbfb31f1e14a8dc93490059.tar.gz
Await having created the user mailbox in a cyrus imap murder topology
-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 e540bc0..046fdbd 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -385,6 +385,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(