summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiutauras Adomaitis <adomaitis@kolabsys.com>2018-03-12 15:18:56 +0200
committerLiutauras Adomaitis <adomaitis@kolabsys.com>2018-03-12 16:20:16 +0200
commitae2ba60049a4e5c4e4ea427dfb59a63547a683ea (patch)
tree707dc2460331f069768b58260d84963ffd88795e
parent3bfbef3a3ed8b5a7f6de0d5fd57ffabaaf582f7a (diff)
downloadpykolab-ae2ba60049a4e5c4e4ea427dfb59a63547a683ea.tar.gz
In some cases kolabd fails to cleanly update IMAP mailbox after LDAP changes. That is usual when result_attribute value is in upper case. Mailbox modification seems to follow slightly different code path, by shortcutting to IMAP pykolab function...
Summary: ..."has_folder()" instead of going via "user_mailbox_exists()", which has a code to downcase mailbox name. Do not shortcut to "has_folder()" function, use "user_mailbox_exists()" to downcase mailbox name before checking if it exists. Test Plan: none Reviewers: vanmeeuwen, machniak Reviewed By: machniak Subscribers: adomaitis, petersen, machniak, vanmeeuwen Differential Revision: https://git.kolab.org/D571
-rw-r--r--pykolab/auth/ldap/__init__.py7
1 files changed, 1 insertions, 6 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 39aab5d..5efa9dc 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -2074,12 +2074,7 @@ class LDAP(pykolab.base.Base):
cache.get_entry(self.domain, entry)
else:
- imap_mailbox = "user%s%s" % (
- self.imap.get_separator(),
- entry[result_attribute]
- )
-
- if not self.imap.has_folder(imap_mailbox):
+ if not self.imap.user_mailbox_exists(entry[result_attribute]):
self.imap.user_mailbox_create(
entry[result_attribute]
)