From: Andrew Lewis Date: Thu, 4 Jan 2018 11:41:46 +0000 (+0200) Subject: [Feature] Multimap: template URL filter X-Git-Tag: 1.7.0~309 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b33a7b88fe9b79f97b19a652781438d90ab1e5f6;p=rspamd.git [Feature] Multimap: template URL filter --- 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()