aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/arc.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-10 18:16:34 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-10 18:16:34 +0100
commit11043c12801e027ad1352dc1f5da943cafb640eb (patch)
treef5e9720de934b38812793a4297fdfd848fb524dd /src/plugins/lua/arc.lua
parentcd994934d1f2bfd7ca484a5588c1d9911f140c35 (diff)
downloadrspamd-11043c12801e027ad1352dc1f5da943cafb640eb.tar.gz
rspamd-11043c12801e027ad1352dc1f5da943cafb640eb.zip
[Feature] Use pure Lua debugm function
Diffstat (limited to 'src/plugins/lua/arc.lua')
-rw-r--r--src/plugins/lua/arc.lua24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index 3ae035b44..ef6a11e71 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -197,7 +197,7 @@ local function arc_callback(task)
return (e1.i or 0) < (e2.i or 0)
end)
- rspamd_logger.debugm(N, task, 'got %s arc sections', #cbdata.seals)
+ lua_util.debugm(N, task, 'got %s arc sections', #cbdata.seals)
-- Now check sanity of what we have
if not arc_validate_seals(task, cbdata.seals, cbdata.sigs,
@@ -210,7 +210,7 @@ local function arc_callback(task)
local function arc_seal_cb(_, res, err, domain)
cbdata.checked = cbdata.checked + 1
- rspamd_logger.debugm(N, task, 'checked arc seal: %s(%s), %s processed',
+ lua_util.debugm(N, task, 'checked arc seal: %s(%s), %s processed',
res, err, cbdata.checked)
if not res then
@@ -233,7 +233,7 @@ local function arc_callback(task)
end
local function arc_signature_cb(_, res, err, domain)
- rspamd_logger.debugm(N, task, 'checked arc signature %s: %s(%s), %s processed',
+ lua_util.debugm(N, task, 'checked arc signature %s: %s(%s), %s processed',
domain, res, err, cbdata.checked)
if not res then
@@ -252,7 +252,7 @@ local function arc_callback(task)
cbdata.res = 'fail'
table.insert(cbdata.errors, string.format('sig:%s:%s', sig.d or '', lerr))
cbdata.checked = cbdata.checked + 1
- rspamd_logger.debugm(N, task, 'checked arc seal %s: %s(%s), %s processed',
+ lua_util.debugm(N, task, 'checked arc seal %s: %s(%s), %s processed',
sig.d, ret, lerr, cbdata.checked)
end
end, cbdata.seals)
@@ -314,7 +314,7 @@ local function arc_callback(task)
table.insert(cbdata.errors, string.format('sig:%s:%s', sig.d or '', err))
else
processed = processed + 1
- rspamd_logger.debugm(N, task, 'processed arc signature %s[%s]: %s(%s), %s processed',
+ lua_util.debugm(N, task, 'processed arc signature %s[%s]: %s(%s), %s processed',
sig.d, sig.i, ret, err, cbdata.checked)
end
@@ -414,18 +414,18 @@ local function arc_sign_seal(task, params, header)
local s = dkim_canonicalize('ARC-Authentication-Results',
arc_auth_results[i].value)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'update signature with header: %s', s)
+ lua_util.debugm(N, task, 'update signature with header: %s', s)
end
if arc_sigs[i] then
local s = dkim_canonicalize('ARC-Message-Signature',
arc_sigs[i].raw_header)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'update signature with header: %s', s)
+ lua_util.debugm(N, task, 'update signature with header: %s', s)
end
if arc_seals[i] then
local s = dkim_canonicalize('ARC-Seal', arc_seals[i].raw_header)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'update signature with header: %s', s)
+ lua_util.debugm(N, task, 'update signature with header: %s', s)
end
end
end
@@ -442,16 +442,16 @@ local function arc_sign_seal(task, params, header)
local s = dkim_canonicalize('ARC-Authentication-Results',
cur_auth_results)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'update signature with header: %s', s)
+ lua_util.debugm(N, task, 'update signature with header: %s', s)
s = dkim_canonicalize('ARC-Message-Signature', header)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'update signature with header: %s', s)
+ lua_util.debugm(N, task, 'update signature with header: %s', s)
local cur_arc_seal = string.format('i=%d; s=%s; d=%s; t=%d; a=rsa-sha256; cv=%s; b=',
cur_idx, params.selector, params.domain, math.floor(rspamd_util.get_time()), params.arc_cv)
s = string.format('%s:%s', 'arc-seal', cur_arc_seal)
sha_ctx:update(s)
- rspamd_logger.debugm(N, task, 'initial update signature with header: %s', s)
+ lua_util.debugm(N, task, 'initial update signature with header: %s', s)
local sig = rspamd_rsa.sign_memory(privkey, sha_ctx:bin())
cur_arc_seal = string.format('%s%s', cur_arc_seal,
@@ -554,7 +554,7 @@ local function arc_signing_cb(task)
local exists,err = rspamd_util.file_exists(p.key)
if not exists then
if err and err == 'No such file or directory' then
- rspamd_logger.debugm(N, task, 'cannot read key from %s: %s', p.key, err)
+ lua_util.debugm(N, task, 'cannot read key from %s: %s', p.key, err)
else
rspamd_logger.warnx(N, task, 'cannot read key from %s: %s', p.key, err)
end