summaryrefslogtreecommitdiffstats
path: root/pykolab/auth/__init__.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-09-26 11:55:06 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-09-26 11:55:06 +0100
commita0071cf51effbb2c0c65f9f6c6e6c060b22ab9e0 (patch)
treeb49ff84636bf9647e774f0724749c42718352e8b /pykolab/auth/__init__.py
parent01ecf279a0dcdde1ab3b22d6d0c8fa4f1f8c6b59 (diff)
downloadpykolab-a0071cf51effbb2c0c65f9f6c6e6c060b22ab9e0.tar.gz
Ensure mail address assigned through Recipient Policies are unique amongst all attributes to a user we consider a valid recipient mail address.
Wrap lines
Diffstat (limited to 'pykolab/auth/__init__.py')
-rw-r--r--pykolab/auth/__init__.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 82e2f4a..eb2d542 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -101,7 +101,12 @@ class Auth(object):
if self._auth.has_key(domain) and not self._auth[domain] == None:
return
- log.debug(_("Connecting to Authentication backend for domain %s") %(domain), level=8)
+ log.debug(
+ _("Connecting to Authentication backend for domain %s") %(
+ domain
+ ),
+ level=8
+ )
if not conf.has_section(section):
section = 'kolab'
@@ -194,7 +199,11 @@ class Auth(object):
return users
def synchronize(self, primary_domain, secondary_domains=[]):
- self.list_users(primary_domain, secondary_domains, callback=self._auth[primary_domain].sync_user)
+ self.list_users(
+ primary_domain,
+ secondary_domains,
+ callback=self._auth[primary_domain].sync_user
+ )
def domain_default_quota(self, domain):
self.connect(domain=domain)
@@ -228,6 +237,14 @@ class Auth(object):
return self._auth[domain]._get_user_attributes(user, attributes)
+ def search_mail_address(self, domain, mail_address):
+ self.connect(domain=domain)
+
+ if self.secondary_domains.has_key(domain):
+ domain = self.secondary_domains[domain]
+
+ return self._auth[domain]._search_mail_address(domain, mail_address)
+
def set_user_attribute(self, domain, user, attribute, value):
self.connect(domain=domain)