diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-11 08:25:11 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-07-11 08:25:11 +0100 |
commit | 1285858a9ed4ec712d95210524cceaa12fae9fd5 (patch) | |
tree | 6f73e0d10c8168d40eba3f3bfba875fb69d382ba | |
parent | 54f90a7cd9bcfefdec22748c33e2f85000d5a357 (diff) | |
download | rspamd-1285858a9ed4ec712d95210524cceaa12fae9fd5.tar.gz rspamd-1285858a9ed4ec712d95210524cceaa12fae9fd5.zip |
[Feature] Allow to attach stat signature to messages
-rw-r--r-- | src/plugins/lua/milter_headers.lua | 16 |
1 files changed, 16 insertions, 0 deletions
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 |