commit fdce734: [Fix] lua_scanners - actions and symbol_fail

Carsten Rosenberg c.rosenberg at heinlein-support.de
Sat Jan 19 20:28:03 UTC 2019


Author: Carsten Rosenberg
Date: 2019-01-19 18:37:35 +0100
URL: https://github.com/rspamd/rspamd/commit/fdce734bca270cb4474cf687cccdd0b2f03c09c7 (refs/pull/2722/head)

[Fix] lua_scanners - actions and symbol_fail

---
 lualib/lua_scanners/common.lua | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua
index de5f77db9..0eeb44bc3 100644
--- a/lualib/lua_scanners/common.lua
+++ b/lualib/lua_scanners/common.lua
@@ -66,16 +66,15 @@ local function yield_result(task, rule, vname, dyn_weight, is_fail)
   local patterns
   local symbol
 
+  -- This should be more generic
   if not is_fail then
     patterns = rule.patterns
     symbol = rule.symbol
     if not dyn_weight then dyn_weight = 1.0 end
-    lua_util.debugm(rule.name, task, '%s: no fail: %s',rule.log_prefix, symbol)
   elseif is_fail == 'fail' then
     patterns = rule.patterns_fail
     symbol = rule.symbol_fail
     dyn_weight = 0.0
-    lua_util.debugm(rule.name, task, '%s: FAIL: %s',rule.log_prefix, symbol)
   end
 
   if type(vname) == 'string' then
@@ -103,7 +102,7 @@ local function yield_result(task, rule, vname, dyn_weight, is_fail)
       end
     end
   end
-  if rule.action then
+  if rule.action and is_fail ~= 'fail' then
     if type(vname) == 'table' then
       if all_whitelisted then return end
       vname = table.concat(vname, '; ')


More information about the Commits mailing list