summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/arc.lua
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-06-10 15:45:29 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-06-10 15:45:29 +0200
commitc30cfcb21a5d1b2fa14944ff3633198a95ea3c2d (patch)
treea947837bbd92ed3bdf4a22b54dd6b492e9500246 /src/plugins/lua/arc.lua
parentcd0cc6187ed4b153e3506bbf79d28aa760a85f4a (diff)
downloadrspamd-c30cfcb21a5d1b2fa14944ff3633198a95ea3c2d.tar.gz
rspamd-c30cfcb21a5d1b2fa14944ff3633198a95ea3c2d.zip
[Feature] Bayes expiry plugin
Diffstat (limited to 'src/plugins/lua/arc.lua')
-rw-r--r--src/plugins/lua/arc.lua15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index fc1c65769..a29417d74 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -335,19 +335,6 @@ rspamd_config:register_symbol({
rspamd_config:register_dependency(id, symbols['spf_allow_symbol'])
rspamd_config:register_dependency(id, symbols['dkim_allow_symbol'])
--- Signatures part
-local function simple_template(tmpl, keys)
- local lpeg = require "lpeg"
-
- local var_lit = lpeg.P { lpeg.R("az") + lpeg.R("AZ") + lpeg.R("09") + "_" }
- local var = lpeg.P { (lpeg.P("$") / "") * ((var_lit^1) / keys) }
- local var_braced = lpeg.P { (lpeg.P("${") / "") * ((var_lit^1) / keys) * (lpeg.P("}") / "") }
-
- local template_grammar = lpeg.Cs((var + var_braced + 1)^0)
-
- return lpeg.match(template_grammar, tmpl)
-end
-
local function arc_sign_seal(task, params, header)
local arc_sigs = task:cache_get('arc-sigs')
local arc_seals = task:cache_get('arc-seals')
@@ -514,7 +501,7 @@ local function arc_signing_cb(task)
end
else
if (p.key and p.selector) then
- p.key = simple_template(p.key, {domain = p.domain, selector = p.selector})
+ p.key = lua_util.template(p.key, {domain = p.domain, selector = p.selector})
local dret, hdr = dkim_sign(task, p)
if dret then
return arc_sign_seal(task, p, hdr)