]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Add support of 'special' SA headers to 'exists' function
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 7 Dec 2015 11:31:28 +0000 (11:31 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 7 Dec 2015 11:31:28 +0000 (11:31 +0000)
src/plugins/lua/spamassassin.lua

index ea2f9547710814b426e704dd01668c14dad9d8f4..39dd5cd8c35b9642086f17173bee5f424865fad8 100644 (file)
@@ -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,