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:41:29 +0200
commitf1351a4c2485a9be8f0a524e63652addcb385a5d (patch)
treed4bdf233b9a4212bed9562e32309ef127f984ffe
parentfeaaf5b27be3493f90ba3d9627f7b63c79f87bc9 (diff)
downloadpykolab-f1351a4c2485a9be8f0a524e63652addcb385a5d.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 0a564fa..1c41924 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -566,6 +566,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 8dff05e..8ea2c89 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):
"""