aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2018-01-04 13:41:46 +0200
committerAndrew Lewis <nerf@judo.za.org>2018-01-04 13:41:46 +0200
commitb33a7b88fe9b79f97b19a652781438d90ab1e5f6 (patch)
tree23b737153af15cb4f33651b06e2ab56b52a75358 /src
parenta7dcf4ce8a5cd985117d51429bbc63a3935d37e8 (diff)
downloadrspamd-b33a7b88fe9b79f97b19a652781438d90ab1e5f6.tar.gz
rspamd-b33a7b88fe9b79f97b19a652781438d90ab1e5f6.zip
[Feature] Multimap: template URL filter
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/multimap.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/lua/multimap.lua b/src/plugins/lua/multimap.lua
index 252c592ff..60324fac1 100644
--- a/src/plugins/lua/multimap.lua
+++ b/src/plugins/lua/multimap.lua
@@ -210,6 +210,14 @@ local function apply_url_filter(task, filter, url, r)
return nil
end
end
+ elseif string.find(filter, '^template:') then
+ if not r['template'] then
+ r['template'] = string.match(filter, '^template:(.+)')
+ end
+
+ if r['template'] then
+ return lua_util.template(r['template'], url:to_table())
+ end
end
return url:get_host()