summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-16 19:41:29 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-05-16 19:48:22 +0200
commitff1aa0f1e2fa7cd7c33eb5d7f046f548da9e69da (patch)
treec24f2fed68ea062f9caad8b581324c239e03eaa9
parent9877c353bb00d9a1eeae7bafe51c727836a0d921 (diff)
downloadpykolab-ff1aa0f1e2fa7cd7c33eb5d7f046f548da9e69da.tar.gz
Make sure a failing recipient policy does not result in a blocked process (#1878)
-rw-r--r--pykolab/auth/ldap/__init__.py3
-rw-r--r--pykolab/plugins/recipientpolicy/__init__.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 93cfc19..d1c2642 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -567,6 +567,9 @@ class LDAP(pykolab.base.Base):
}
)
+ if primary_mail_address == None:
+ return entry_modifications
+
i = 1
_primary_mail = primary_mail_address
diff --git a/pykolab/plugins/recipientpolicy/__init__.py b/pykolab/plugins/recipientpolicy/__init__.py
index e3d6b65..59146c1 100644
--- a/pykolab/plugins/recipientpolicy/__init__.py
+++ b/pykolab/plugins/recipientpolicy/__init__.py
@@ -77,9 +77,10 @@ class KolabRecipientpolicy(object):
return mail
except KeyError, e:
log.warning(_("Attribute substitution for 'mail' failed in Recipient Policy"))
- mail = utils.translate(user_attrs['mail'], user_attrs['preferredlanguage'])
- mail = mail.lower()
- return mail
+ if user_attrs.has_key('mail'):
+ return mail
+ else:
+ return None
def set_secondary_mail(self, *args, **kw):
"""