From: Vsevolod Stakhov Date: Tue, 31 Mar 2015 11:25:17 +0000 (+0100) Subject: Skip comments at the end of SA rules. X-Git-Tag: 0.9.0~381 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6508194d6a66db21b59b8a32a35daeeb9dfaf049;p=thirdparty%2Frspamd.git Skip comments at the end of SA rules. --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index 170997f159..0e8409f35c 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