summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-21 10:16:46 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-21 10:19:06 +0100
commit4e8183e45765d65889d1b24be2f136e7c7b41a4e (patch)
tree118a7789ee59a3a4906edcd3c836c1ecdc128f6d
parentbe82be3a3a0f06a8a4997ce13be2166b5637848b (diff)
downloadpykolab-4e8183e45765d65889d1b24be2f136e7c7b41a4e.tar.gz
If a realm is specified, can be found, use that realm to instantiate Auth (or use the primary_domain) (#852)
-rw-r--r--saslauthd/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/saslauthd/__init__.py b/saslauthd/__init__.py
index 6daebf3..4b45fc1 100644
--- a/saslauthd/__init__.py
+++ b/saslauthd/__init__.py
@@ -146,8 +146,16 @@ class SASLAuthDaemon(object):
end = start + 2
login.append(value)
- auth = Auth()
+ if len(login) == 4:
+ realm = login[3]
+ elif len(login[0].split('@')) > 1:
+ realm = login[0].split('@')[1]
+ else:
+ realm = conf.get('kolab', 'primary_domain')
+
+ auth = Auth(domain=realm)
auth.connect()
+
if auth.authenticate(login):
clientsocket.send(struct.pack("!H2s", 2, "OK"))
else: