3 commits - bin/kolab_smtp_access_policy.py pykolab/cli pykolab/plugins

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Wed Jan 9 16:36:24 CET 2013


 bin/kolab_smtp_access_policy.py       |    5 ++++-
 pykolab/cli/sieve/cmd_refresh.py      |    4 ++++
 pykolab/plugins/sievemgmt/__init__.py |    4 +++-
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 165602c5f24ee847c213e579f5690c4cd11e1e3f
Merge: 567b82e 2e28430
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jan 9 15:36:07 2013 +0000

    Merge branch 'master' of ssh://git.kolabsys.com/git/pykolab



commit 567b82e0cdd8359a02730fd4ab6921636b7d82f5
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Wed Jan 9 14:01:28 2013 +0000

    Require at least one extension (that does not hurt)
    Fix indentation of user defined script inclusion

diff --git a/pykolab/cli/sieve/cmd_refresh.py b/pykolab/cli/sieve/cmd_refresh.py
index 226fb93..8d5703f 100644
--- a/pykolab/cli/sieve/cmd_refresh.py
+++ b/pykolab/cli/sieve/cmd_refresh.py
@@ -257,6 +257,8 @@ def execute(*args, **kw):
     for required_extension in mgmt_required_extensions:
         mgmt_script.require(required_extension)
 
+    mgmt_script.require('fileinto')
+
     if vacation_active:
         if not vacation_react_domains == None and len(vacation_react_domains) > 0:
             mgmt_script.addfilter(
@@ -349,6 +351,8 @@ def execute(*args, **kw):
 
     mgmt_script = mgmt_script.__str__()
 
+    log.debug(_("MANAGEMENT Script contents: %r") % (mgmt_script), level=9)
+
     result = sieveclient.putscript("MANAGEMENT", mgmt_script)
 
     if not result:
diff --git a/pykolab/plugins/sievemgmt/__init__.py b/pykolab/plugins/sievemgmt/__init__.py
index 1e22a47..e87381c 100644
--- a/pykolab/plugins/sievemgmt/__init__.py
+++ b/pykolab/plugins/sievemgmt/__init__.py
@@ -270,6 +270,8 @@ class KolabSievemgmt(object):
         for required_extension in mgmt_required_extensions:
             mgmt_script.require(required_extension)
 
+        mgmt_script.require('fileinto')
+
         if vacation_active:
             if not vacation_react_domains == None and len(vacation_react_domains) > 0:
                 mgmt_script.addfilter(
@@ -381,7 +383,7 @@ require ["include"];
                 print "Including script %s in USER" % (script)
                 user_script = """%s
 
-    include :personal "%s";
+include :personal "%s";
     """ % (user_script, script)
 
         result = sieveclient.putscript("USER", user_script)


commit 8adf015a4dd7944ee4e8c6d29b4578da496ae2ad
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 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
             )
 





More information about the commits mailing list