summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: