Branch 'pykolab-0.5' - bin/kolab_smtp_access_policy.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed Jan 9 15:03:22 CET 2013


 bin/kolab_smtp_access_policy.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit c13045e4e2b8ba594c4b8c806aa4f22267585732
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jan 9 13:59:29 2013 +0000

    Make sure the sasl_username is realmed, or we run in to server configuration problem errors

diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index 794f3d7..542345e 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
             )
 





More information about the commits mailing list