summaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-14 15:16:33 +0100
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-14 15:16:33 +0100
commitda56fcd711ae4225f36e3f8bdce3ebe82d1d735f (patch)
tree44e68d60fcd0804fe38ad3e52ff787d93597e93c /lualib
parent8928bebaa3be80655836be2a92e714296564267c (diff)
downloadrspamd-da56fcd711ae4225f36e3f8bdce3ebe82d1d735f.tar.gz
rspamd-da56fcd711ae4225f36e3f8bdce3ebe82d1d735f.zip
[Minor] lua_scanners - dcc save clean
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_scanners/dcc.lua23
1 files changed, 15 insertions, 8 deletions
diff --git a/lualib/lua_scanners/dcc.lua b/lualib/lua_scanners/dcc.lua
index 5875eec1b..5b3bbaf50 100644
--- a/lualib/lua_scanners/dcc.lua
+++ b/lualib/lua_scanners/dcc.lua
@@ -133,7 +133,6 @@ local function dcc_check(task, content, digest, rule)
if header then
local _,_,info = header:find("; (.-)$")
-
if (result == 'R') then
-- Reject
common.yield_result(task, rule, info, rule.default_score)
@@ -143,12 +142,6 @@ local function dcc_check(task, content, digest, rule)
rspamd_logger.warnx(task, 'DCC returned a temporary failure result: %s', result)
dcc_requery()
elseif result == 'A' then
- if rule.log_clean then
- rspamd_logger.infox(task, '%s: clean, returned result A - info: %s',
- rule.log_prefix, info)
- else
- lua_util.debugm(rule.module_name, task, '%s: returned result A - info: %s',
- rule.log_prefix, info)
local opts = {}
local score = 0.0
@@ -199,10 +192,19 @@ local function dcc_check(task, content, digest, rule)
score,
opts)
common.save_av_cache(task, digest, rule, opts, score)
+ else
+ common.save_av_cache(task, digest, rule, 'OK')
+ if rule.log_clean then
+ rspamd_logger.infox(task, '%s: clean, returned result A - info: %s',
+ rule.log_prefix, info)
+ else
+ lua_util.debugm(rule.module_name, task, '%s: returned result A - info: %s',
+ rule.log_prefix, info)
end
end
elseif result == 'G' then
-- do nothing
+ common.save_av_cache(task, digest, rule, 'OK')
if rule.log_clean then
rspamd_logger.infox(task, '%s: clean, returned result G - info: %s', rule.log_prefix, info)
else
@@ -210,6 +212,7 @@ local function dcc_check(task, content, digest, rule)
end
elseif result == 'S' then
-- do nothing
+ common.save_av_cache(task, digest, rule, 'OK')
if rule.log_clean then
rspamd_logger.infox(task, '%s: clean, returned result S - info: %s', rule.log_prefix, info)
else
@@ -240,7 +243,11 @@ local function dcc_check(task, content, digest, rule)
})
end
if common.need_av_check(task, content, rule) then
- dcc_check_uncached()
+ if common.check_av_cache(task, digest, rule, dcc_check_uncached) then
+ return
+ else
+ dcc_check_uncached()
+ end
end
end