]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Antivirus: process table results correctly; prettify logging
authorAndrew Lewis <nerf@judo.za.org>
Fri, 7 Apr 2017 13:29:27 +0000 (15:29 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Fri, 7 Apr 2017 13:34:49 +0000 (15:34 +0200)
src/plugins/lua/antivirus.lua

index e10f7f3fce674132a7fe49cc095b87e045ff3d16..277a95c2b2c8afe36902cb02effd010f6151e160 100644 (file)
@@ -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