]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix issues with fail symbol in AV module
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Apr 2018 18:20:42 +0000 (19:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 30 Apr 2018 18:20:42 +0000 (19:20 +0100)
src/plugins/lua/antivirus.lua

index 5abf652f8b65640b41353e29e67d68a430eda9de..ff64618cbe6d00c95393d2ca1a790ff5bb50371f 100644 (file)
@@ -393,10 +393,12 @@ local function fprot_check(task, rule)
             })
           else
             rspamd_logger.errx(task, 'failed to scan, maximum retransmits exceed')
+            task:insert_result(rule['symbol_fail'], 0.0, 'retransmits exceed')
             upstream:fail()
           end
         else
           rspamd_logger.errx(task, 'failed to scan: %s', err)
+          task:insert_result(rule['symbol_fail'], 0.0, 'failed to scan')
           upstream:fail()
         end
       else
@@ -776,6 +778,7 @@ local av_types = {
 
 local function add_antivirus_rule(sym, opts)
   if not opts['type'] then
+    rspamd_logger.errx(rspamd_config, 'unknown type for AV rule %s', sym)
     return nil
   end
 
@@ -793,6 +796,7 @@ local function add_antivirus_rule(sym, opts)
 
   local rule = cfg.configure(opts)
   rule.type = opts.type
+  rule.symbol_fail = opts.symbol_fail
 
 
   if not rule then