summaryrefslogtreecommitdiffstats
path: root/ucs
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-04 14:43:24 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-10-04 14:43:24 +0200
commitcd2b45bf4ef9a7b08fc48b2bd82fac0bc7907836 (patch)
tree4140ec95f220f292d0b164131c828f8d1ab1663a /ucs
parent490c75fe2c977a5f04461e530cb5c2dc5af890c6 (diff)
downloadpykolab-cd2b45bf4ef9a7b08fc48b2bd82fac0bc7907836.tar.gz
Allow Univention Configuration Registry to influence whether or we delete any mailboxes (#1003420)
Diffstat (limited to 'ucs')
-rwxr-xr-xucs/listener.py20
1 files changed, 12 insertions, 8 deletions
diff --git a/ucs/listener.py b/ucs/listener.py
index 232675e..0849640 100755
--- a/ucs/listener.py
+++ b/ucs/listener.py
@@ -25,7 +25,7 @@ import listener
import logging
import os
import sys
-import univention_baseconfig
+from univention.config_registry import ConfigRegistry
import univention.debug as ulog
sys.path = [
@@ -147,13 +147,17 @@ def handler(*args, **kw):
else:
log.info("Entry deletion notification for %r does not have a mail server attribute specified." % (dn))
- auth._auth._synchronize_callback(
- change_type = 'delete',
- previous_dn = None,
- change_number = None,
- dn = dn,
- entry = old
- )
+ cfg = ConfigRegistry()
+ cfg.load()
+
+ if cfg.is_true('mail/cyrus/mailbox/delete', True):
+ auth._auth._synchronize_callback(
+ change_type = 'delete',
+ previous_dn = None,
+ change_number = None,
+ dn = dn,
+ entry = old
+ )
elif isinstance(new, dict) and len(new.keys()) > 0:
# Old is not a dict (or empty), so the entry is just created