diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-31 12:25:17 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-31 12:25:17 +0100 |
commit | 6508194d6a66db21b59b8a32a35daeeb9dfaf049 (patch) | |
tree | fbeca04a03a2619abeba77866b772480282ed307 | |
parent | 4ff824245805bfabdfaeb50c1ec46387bc06425b (diff) | |
download | rspamd-6508194d6a66db21b59b8a32a35daeeb9dfaf049.tar.gz rspamd-6508194d6a66db21b59b8a32a35daeeb9dfaf049.zip |
Skip comments at the end of SA rules.
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 8 |
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 |