From: Christian Roessner Date: Wed, 22 Feb 2017 12:43:01 +0000 (+0100) Subject: [Minor] Add log_clean option for SAVAPI X-Git-Tag: 1.5.0~59^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1448%2Fhead;p=rspamd.git [Minor] Add log_clean option for SAVAPI --- diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index b3bc27631..ae0cd6b14 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -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: ; ; 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