aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_scanners
diff options
context:
space:
mode:
authorGregor Dschung <gregor@chkpnt.de>2020-04-19 10:33:17 +0200
committerGregor Dschung <gregor@chkpnt.de>2020-04-19 10:50:18 +0200
commit1b2b501ceb111303062e9a5f247d01cd85e87c1c (patch)
treef875660851e3114cde06adf9b2fb8f3b9f4068ae /lualib/lua_scanners
parent7f2cdca0bba88179d8a5cb0b621eb263964525a2 (diff)
downloadrspamd-1b2b501ceb111303062e9a5f247d01cd85e87c1c.tar.gz
rspamd-1b2b501ceb111303062e9a5f247d01cd85e87c1c.zip
[Fix] Do not flag pre-result of virus scanners as least if action is reject
fixes #3279
Diffstat (limited to 'lualib/lua_scanners')
-rw-r--r--lualib/lua_scanners/common.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua
index f286d963a..5c298b46f 100644
--- a/lualib/lua_scanners/common.lua
+++ b/lualib/lua_scanners/common.lua
@@ -68,6 +68,7 @@ local function yield_result(task, rule, vname, dyn_weight, is_fail)
local symbol
local threat_table = {}
local threat_info
+ local flags
-- This should be more generic
if not is_fail then
@@ -112,11 +113,14 @@ local function yield_result(task, rule, vname, dyn_weight, is_fail)
if rule.action and is_fail ~= 'fail' and not all_whitelisted then
threat_table = table.concat(threat_table, '; ')
+ if rule.action ~= 'reject' then
+ flags = 'least'
+ end
task:set_pre_result(rule.action,
lua_util.template(rule.message or 'Rejected', {
SCANNER = rule.name,
VIRUS = threat_table,
- }), rule.name, nil, nil, 'least')
+ }), rule.name, nil, nil, flags)
end
end