diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-07 11:31:28 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-07 11:31:28 +0000 |
commit | 64e533b717c1a426c69a20f2a938271013e5a39e (patch) | |
tree | 22895b32f104d0a446a9370ae8707cbf531df373 | |
parent | 407f3c9c0a151ff9c6322e207db6b7c78619b6ad (diff) | |
download | rspamd-64e533b717c1a426c69a20f2a938271013e5a39e.tar.gz rspamd-64e533b717c1a426c69a20f2a938271013e5a39e.zip |
Add support of 'special' SA headers to 'exists' function
-rw-r--r-- | src/plugins/lua/spamassassin.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index ea2f95477..39dd5cd8c 100644 --- a/src/plugins/lua/spamassassin.lua +++ b/src/plugins/lua/spamassassin.lua @@ -376,8 +376,23 @@ local function maybe_parse_sa_function(line) local substitutions = { {'^exists:', function(task) -- filter - if task:get_header(arg) then - return 1 + local hdrs_check = {} + if arg == 'MESSAGEID' then + hdrs_check = { + 'Message-ID', + 'X-Message-ID', + 'Resent-Message-ID' + } + elseif arg == 'ToCc' then + hdrs_check = { 'To', 'Cc', 'Bcc' } + else + hdrs_check = {arg} + end + + for i,h in ipairs(hdrs_check) do + if task:get_header(h) then + return 1 + end end return 0 end, |