summaryrefslogtreecommitdiffstats
path: root/saslauthd
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:17:27 +0100
commit52fae42619833a394dde8cf755dd4f77da52c7d4 (patch)
treee4d0f810c9a4464d3ce7be9f64807d42f7371a64 /saslauthd
parent0e0c89b4f89d15a01aef61689ec899fa2a958e2d (diff)
downloadpykolab-52fae42619833a394dde8cf755dd4f77da52c7d4.tar.gz
If a realm is specified, can be found, use that realm to instantiate Auth (or use the primary_domain) (#852)
Diffstat (limited to 'saslauthd')
-rw-r--r--saslauthd/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/saslauthd/__init__.py b/saslauthd/__init__.py
index 3cf6efb..b5c4f4d 100644
--- a/saslauthd/__init__.py
+++ b/saslauthd/__init__.py
@@ -159,8 +159,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: