diff options
-rw-r--r-- | src/plugins/lua/milter_headers.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index dcf8e9ffd..52cd874a6 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -35,6 +35,13 @@ local settings = { authenticated_headers = {}, extended_headers_rcpt = {}, routines = { + ['remove-headers'] = { + headers = {}, + }, + ['add-headers'] = { + headers = {}, + remove = 1, + }, ['remove-header'] = { remove = 1, }, @@ -201,6 +208,21 @@ local function milter_headers(task) end end + routines['remove-headers'] = function() + if skip_wanted('remove-headers') then return end + for h, r in pairs(settings.routines['remove-headers'].headers) do + remove[h] = r + end + end + + routines['add-headers'] = function() + if skip_wanted('add-headers') then return end + for h, r in pairs(settings.routines['add-headers'].headers) do + add[h] = r + remove[h] = settings.routines['add-headers'].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 |