Branch 'pykolab-0.4' - 2 commits - conf/kolab.conf saslauthd/__init__.py
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Thu Jun 21 11:19:31 CEST 2012
conf/kolab.conf | 3 +++
saslauthd/__init__.py | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
New commits:
commit 664da0b0fc236b1b170cfa0fc52bae4cbc9483a4
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Jun 21 10:18:44 2012 +0100
Add mailserver_attribute to the default configuration
diff --git a/conf/kolab.conf b/conf/kolab.conf
index 03bfd06..e9744d0 100644
--- a/conf/kolab.conf
+++ b/conf/kolab.conf
@@ -116,6 +116,9 @@ unique_attribute = nsuniqueid
; a recipient policy.
mail_attributes = mail, alias
+; The attribute that holds the FQDN to the mail server the folder exists on
+mailserver_attribute = mailhost
+
; Attributes that hold valid authentication login names. Use 'mail', 'alias' and
; optionally 'uid' (the uid is marked as an auth_attribute automatically), so
; that a user can login with;
commit 4e8183e45765d65889d1b24be2f136e7c7b41a4e
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Jun 21 10:16:46 2012 +0100
If a realm is specified, can be found, use that realm to instantiate Auth (or use the primary_domain) (#852)
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:
More information about the commits
mailing list