]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Multimap: template URL filter
authorAndrew Lewis <nerf@judo.za.org>
Thu, 4 Jan 2018 11:41:46 +0000 (13:41 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Thu, 4 Jan 2018 11:41:46 +0000 (13:41 +0200)
src/plugins/lua/multimap.lua

index 252c592ff405db5ec30853e469cc929c26212261..60324fac1063fa13dcab763f6cc23aa837d5168d 100644 (file)
@@ -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()