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:58:49 +0100
commit7c38740c616db74abebfffc659904bcb068132f4 (patch)
tree3163c1cb51647ee6b29837972a662a3d5210bd04
parent590be45fa96375bfb73a0693e51d49da30bc8cff (diff)
downloadpykolab-7c38740c616db74abebfffc659904bcb068132f4.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 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(