]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add log_clean option for SAVAPI 1448/head
authorChristian Roessner <c@roessner-network-solutions.com>
Wed, 22 Feb 2017 12:43:01 +0000 (13:43 +0100)
committerChristian Roessner <c@roessner-network-solutions.com>
Wed, 22 Feb 2017 12:43:01 +0000 (13:43 +0100)
src/plugins/lua/antivirus.lua

index b3bc276315e4469a755f1a3c6bfdec58c6f0efbc..ae0cd6b1448d87986cf7e054a6d197fc9eb8d636 100644 (file)
@@ -172,6 +172,7 @@ local function savapi_config(opts)
     attachments_only = true,
     default_port = 4444, -- note: You must set ListenAddress in savapi.conf
     product_id = 0,
+    log_clean = false,
     timeout = 15.0,
     retransmits = 2,
     cache_expire = 3600, -- expire redis in one hour
@@ -507,6 +508,9 @@ local function savapi_check(task, rule)
       if string.find(result, '200') or string.find(result, '210') then
         -- clean message
         rspamd_logger.debugm(N, task, 'clean message')
+       if rule['log_clean'] then
+          rspamd_logger.infox(task, 'SAVAPI: message is clean')
+        end
         save_av_cache(task, rule, 'OK')
 
       elseif string.find(result, '310') then
@@ -516,7 +520,7 @@ local function savapi_check(task, rule)
         local message = parts[2]
         -- A message: <alert> ; <type> ; <description>
         local vname = rspamd_str_split(message, ';')[1]
-        rspamd_logger.infox(task, 'virus found: %s', vname)
+        rspamd_logger.infox(task, 'SAVAPI: virus found: %s', vname)
         yield_result(task, rule, vname)
         save_av_cache(task, rule, vname)
       end