aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-31 12:25:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-31 12:25:17 +0100
commit6508194d6a66db21b59b8a32a35daeeb9dfaf049 (patch)
treefbeca04a03a2619abeba77866b772480282ed307
parent4ff824245805bfabdfaeb50c1ec46387bc06425b (diff)
downloadrspamd-6508194d6a66db21b59b8a32a35daeeb9dfaf049.tar.gz
rspamd-6508194d6a66db21b59b8a32a35daeeb9dfaf049.zip
Skip comments at the end of SA rules.
-rw-r--r--src/plugins/lua/spamassassin.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua
index 170997f15..0e8409f35 100644
--- a/src/plugins/lua/spamassassin.lua
+++ b/src/plugins/lua/spamassassin.lua
@@ -139,7 +139,13 @@ local function process_sa_conf(f)
local slash = string.find(l, '/')
- words = _.totable(_.filter(function(w) return w ~= "" end, _.iter(split(l))))
+ -- Skip comments
+ words = _.totable(_.take_while(
+ function(w) return string.sub(w, 1, 1) ~= '#' end,
+ _.filter(function(w)
+ return w ~= "" end,
+ _.iter(split(l)))))
+
if words[1] == "header" then
-- header SYMBOL Header ~= /regexp/
if valid_rule then