From 1285858a9ed4ec712d95210524cceaa12fae9fd5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 11 Jul 2017 08:25:11 +0100 Subject: [PATCH] [Feature] Allow to attach stat signature to messages --- src/plugins/lua/milter_headers.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index 52cd874a6..009af075a 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -112,6 +112,10 @@ local settings = { quarantine = 'DMARC_POLICY_QUARANTINE', }, }, + ['stat-signature'] = { + header = 'X-Stat-Signature', + remove = 1, + }, }, } @@ -356,6 +360,18 @@ local function milter_headers(task) end end + routines['stat-signature'] = function() + if skip_wanted('stat-signature') then return end + if settings.routines['stat-signature'].remove then + remove[settings.routines['stat-signature'].header] = + settings.routines['stat-signature'].remove + end + local res = task:get_mempool():get_variable("stat_signature") + if res then + add[settings.routines['stat-signature'].header] = res + end + end + for _, n in ipairs(active_routines) do local ok, err if custom_routines[n] then -- 2.39.5