]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Support forcing action in antivirus plugin 1161/head
authorAndrew Lewis <nerf@judo.za.org>
Tue, 22 Nov 2016 06:12:14 +0000 (08:12 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Tue, 22 Nov 2016 09:24:46 +0000 (11:24 +0200)
src/plugins/lua/antivirus.lua

index 0ae2170b65200678a8c77d4a604802b966712c11..6060b0e8967e0f33faa263dc04715e052b2dc4fa 100644 (file)
@@ -39,6 +39,10 @@ local function yield_result(task, rule, vname)
   end
   task:insert_result(symname, 1.0, vname)
   rspamd_logger.infox(task, '%s: virus found: "%s"', rule['type'], vname)
+  if rule['action'] then
+    task:set_pre_result(rule['action'],
+        string.format('%s: virus found: "%s"', rule['type'], vname))
+  end
 end
 
 local function clamav_config(opts)