From: Vsevolod Stakhov Date: Mon, 7 Dec 2015 11:31:28 +0000 (+0000) Subject: Add support of 'special' SA headers to 'exists' function X-Git-Tag: 1.1.0~393 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=64e533b717c1a426c69a20f2a938271013e5a39e;p=thirdparty%2Frspamd.git Add support of 'special' SA headers to 'exists' function --- diff --git a/src/plugins/lua/spamassassin.lua b/src/plugins/lua/spamassassin.lua index ea2f954771..39dd5cd8c3 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,