summaryrefslogtreecommitdiffstats
path: root/bin/kolab_smtp_access_policy.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-01-09 13:59:29 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-01-09 13:59:29 +0000
commit8adf015a4dd7944ee4e8c6d29b4578da496ae2ad (patch)
tree0a2de1aac91ec8f8b80b016862cbae4c6267ed6e /bin/kolab_smtp_access_policy.py
parentd6b6405aa30fc974d954d75b79bcffd22a093737 (diff)
downloadpykolab-8adf015a4dd7944ee4e8c6d29b4578da496ae2ad.tar.gz
Make sure the sasl_username is realmed, or we run in to server configuration problem errors
Diffstat (limited to 'bin/kolab_smtp_access_policy.py')
-rwxr-xr-xbin/kolab_smtp_access_policy.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index 151cc4c..0320973 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -448,6 +448,8 @@ class PolicyRequest(object):
# If unauthenticated is allowed, I have nothing to do here.
return True
+ sasl_username = self.sasl_username
+
# If we have an sasl_username, find the user object in the
# authentication database, along with the attributes we are
# interested in.
@@ -456,6 +458,7 @@ class PolicyRequest(object):
self.sasl_domain = self.sasl_username.split('@')[1]
else:
self.sasl_domain = conf.get('kolab', 'primary_domain')
+ sasl_username = "%s@%s" % (self.sasl_username, self.sasl_domain)
if self.auth == None:
self.auth = Auth(self.sasl_domain)
@@ -463,7 +466,7 @@ class PolicyRequest(object):
self.auth = Auth(self.sasl_domain)
sasl_users = self.auth.find_recipient(
- self.sasl_username,
+ sasl_username,
domain=self.sasl_domain
)