From 6508194d6a66db21b59b8a32a35daeeb9dfaf049 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 31 Mar 2015 12:25:17 +0100 Subject: [PATCH] Skip comments at the end of SA rules. --- src/plugins/lua/spamassassin.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.5