aboutsummaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-14 15:17:22 +0100
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2019-01-14 15:17:22 +0100
commit246319f03153a569d861f37fdb20f0ca711ffaad (patch)
tree82831450e02181ab18d6fda867d416b1737c2ee8 /lualib
parentda56fcd711ae4225f36e3f8bdce3ebe82d1d735f (diff)
downloadrspamd-246319f03153a569d861f37fdb20f0ca711ffaad.tar.gz
rspamd-246319f03153a569d861f37fdb20f0ca711ffaad.zip
[Minor] lua_scanners - common - log_clean function
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_scanners/common.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua
index 43400c375..0c76004eb 100644
--- a/lualib/lua_scanners/common.lua
+++ b/lualib/lua_scanners/common.lua
@@ -28,6 +28,18 @@ local fun = require "fun"
local exports = {}
+local function log_clean(task, rule, msg)
+
+ msg = msg or 'message or mime_part is clean'
+
+ if rule.log_clean then
+ rspamd_logger.infox(task, '%s: %s', rule.log_prefix, msg)
+ else
+ lua_util.debugm(rule.module_name, task, '%s: %s', rule.log_prefix, msg)
+ end
+
+end
+
local function match_patterns(default_sym, found, patterns, dyn_weight)
if type(patterns) ~= 'table' then return default_sym, dyn_weight end
if not patterns[1] then
@@ -286,6 +298,7 @@ local function check_parts_match(task, rule)
return fun.filter(filter_func, task:get_parts())
end
+exports.log_clean = log_clean
exports.yield_result = yield_result
exports.match_patterns = match_patterns
exports.need_av_check = need_av_check