summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-04-07 15:29:27 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-04-07 15:34:49 +0200
commitb9ef79d942ab8c71b2b05ca9d0d1adb01d1f0755 (patch)
tree2322ce7b5b6a47e599f327409727416ba7bd86f2 /src
parent7d1f4d68ac3f70609b3a5a48fbfb36975e5b707e (diff)
downloadrspamd-b9ef79d942ab8c71b2b05ca9d0d1adb01d1f0755.tar.gz
rspamd-b9ef79d942ab8c71b2b05ca9d0d1adb01d1f0755.zip
[Minor] Antivirus: process table results correctly; prettify logging
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/antivirus.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua
index e10f7f3fc..277a95c2b 100644
--- a/src/plugins/lua/antivirus.lua
+++ b/src/plugins/lua/antivirus.lua
@@ -50,14 +50,17 @@ local function yield_result(task, rule, vname)
for _, vn in ipairs(vname) do
local symname = match_patterns(rule['symbol'], vn, rule['patterns'])
if rule['whitelist'] and rule['whitelist']:get_key(vn) then
- rspamd_logger.infox(task, '%s: "%s" is in whitelist', rule['type'], vname)
+ rspamd_logger.infox(task, '%s: "%s" is in whitelist', rule['type'], vn)
else
- task:insert_result(symname, 1.0, vname)
- rspamd_logger.infox(task, '%s: virus found: "%s"', rule['type'], vname)
+ task:insert_result(symname, 1.0, vn)
+ rspamd_logger.infox(task, '%s: virus found: "%s"', rule['type'], vn)
end
end
end
if rule['action'] then
+ if type(vname) == 'table' then
+ vname = table.concat(vname, '; ')
+ end
task:set_pre_result(rule['action'],
string.format('%s: virus found: "%s"', rule['type'], vname))
end