summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2019-05-29 11:12:58 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2019-05-29 12:36:56 +0200
commitb8721eb59f8afa0471f0b8a0430dca5cb4011a82 (patch)
tree0a39c41a692fb5c29e2a6f4e78af246ce4548fa3 /pykolab
parent1bf9df4c94e70e38b629469d540a0d135a2b6a0c (diff)
downloadpykolab-b8721eb59f8afa0471f0b8a0430dca5cb4011a82.tar.gz
Let kolab sync also use the configured result_attribute
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/cmd_sync.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/pykolab/cli/cmd_sync.py b/pykolab/cli/cmd_sync.py
index 375303d..7d44d02 100644
--- a/pykolab/cli/cmd_sync.py
+++ b/pykolab/cli/cmd_sync.py
@@ -124,7 +124,12 @@ def _synchronize(*args, **kw):
entry = utils.normalize(kw)
- if not entry.has_key('mail'):
+ mailbox_attribute = conf.get('cyrus-sasl', 'result_attribute')
+ if mailbox_attribute == None:
+ mailbox_attribute = 'mail'
+
+
+ if mailbox_attribute not in entry:
return
if not 'kolabinetorgperson' in entry['objectclass']:
@@ -133,13 +138,13 @@ def _synchronize(*args, **kw):
imap = IMAP()
imap.connect()
- if not imap.user_mailbox_exists(entry['mail']):
+ if not imap.user_mailbox_exists(entry[mailbox_attribute]):
if entry.has_key('mailhost'):
server = entry['mailhost']
else:
server = None
- imap.user_mailbox_create(entry['mail'], server=server)
+ imap.user_mailbox_create(entry[mailbox_attribute], server=server)
imap.disconnect()