]> source.dussan.org Git - rspamd.git/commitdiff
Skip comments at the end of SA rules.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 31 Mar 2015 11:25:17 +0000 (12:25 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 31 Mar 2015 11:25:17 +0000 (12:25 +0100)
src/plugins/lua/spamassassin.lua

index 170997f1592670c5fcd85a8e019e78b72839a611..0e8409f35c1ca7e566d09b743bb3521fc568eacf 100644 (file)
@@ -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