]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Milter headers: remove-header routine
authorAndrew Lewis <nerf@judo.za.org>
Sat, 24 Jun 2017 11:18:48 +0000 (13:18 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Sat, 24 Jun 2017 11:19:28 +0000 (13:19 +0200)
src/plugins/lua/milter_headers.lua

index bdf246a5ae8ecd9aa1609ba80b231698e5323ac9..4ee674ddcdc3e134db62c8b1e654359c47a8194e 100644 (file)
@@ -35,6 +35,9 @@ local settings = {
   authenticated_headers = {},
   extended_headers_rcpt = {},
   routines = {
+    ['remove-header'] = {
+      remove = 1,
+    },
     ['x-spamd-result'] = {
       header = 'X-Spamd-Result',
       remove = 1,
@@ -196,6 +199,13 @@ local function milter_headers(task)
     end
   end
 
+  routines['remove-header'] = function()
+    if skip_wanted('remove-header') then return end
+    if settings.routines['remove-header'].header and settings.routines['x-rspamd-server'].remove then
+      remove[settings.routines['remove-header'].header] = settings.routines['remove-header'].remove
+    end
+  end
+
   routines['x-rspamd-server'] = function()
     if skip_wanted('x-rspamd-server') then return end
     if settings.routines['x-rspamd-server'].remove then