summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pykolab/auth/ldap/__init__.py2
-rw-r--r--pykolab/cli/cmd_sync.py11
2 files changed, 8 insertions, 5 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 8400bfb..3a30621 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -383,8 +383,6 @@ class LDAP(pykolab.base.Base):
self._disconnect()
return False
- auth_cache.set_entry(_filter, entry_dn)
-
except ldap.NO_SUCH_OBJECT, errmsg:
log.debug(
_("Error occured, there is no such object: %r") % (
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()