summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-12 17:06:08 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-02-12 17:06:38 +0100
commit4aa15736969edcf354155f36d99cd53f17be66c1 (patch)
tree18b1e9c11474cfcba438e892b037962186d65513
parent455e9b73874b8f58c055e331f0db2bbba1e4ef20 (diff)
downloadpykolab-4aa15736969edcf354155f36d99cd53f17be66c1.tar.gz
Match messages without an X-Spam-Status header set, too
-rw-r--r--pykolab/cli/sieve/cmd_refresh.py4
-rw-r--r--pykolab/plugins/sievemgmt/__init__.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/pykolab/cli/sieve/cmd_refresh.py b/pykolab/cli/sieve/cmd_refresh.py
index 6c10dfa..b610e2d 100644
--- a/pykolab/cli/sieve/cmd_refresh.py
+++ b/pykolab/cli/sieve/cmd_refresh.py
@@ -344,7 +344,9 @@ def execute(*args, **kw):
mgmt_script.addfilter(rule_name, ['true'], forward_rules)
else:
- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules)
+ # NOTE: Messages with no X-Spam-Status header need to be matched
+ # too, and this does exactly that.
+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules)
if sdf_filter:
mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])
diff --git a/pykolab/plugins/sievemgmt/__init__.py b/pykolab/plugins/sievemgmt/__init__.py
index 42297a4..ade829d 100644
--- a/pykolab/plugins/sievemgmt/__init__.py
+++ b/pykolab/plugins/sievemgmt/__init__.py
@@ -356,7 +356,9 @@ class KolabSievemgmt(object):
mgmt_script.addfilter(rule_name, ['true'], forward_rules)
else:
- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules)
+ # NOTE: Messages with no X-Spam-Status header need to be matched
+ # too, and this does exactly that.
+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules)
if sdf_filter:
mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])