]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] #3400 milter_headers: fix inverted logic for extended_headers_rcpt 3607/head
authorTobias Mädel <t.maedel@alfeld.de>
Thu, 14 Jan 2021 14:29:01 +0000 (15:29 +0100)
committerGitHub <noreply@github.com>
Thu, 14 Jan 2021 14:29:01 +0000 (15:29 +0100)
This commit fixes the inverted logic of skip_wanted/match_extended_headers_rcpt to allow a user to enable extended headers selectively for only a specific set of recipients.

src/plugins/lua/milter_headers.lua

index ec9e2c659b0b8a34ee7aee6079900518cc2bf562..e88d85b3da61f58008b414e167832d70ba3cb7ae 100644 (file)
@@ -158,10 +158,6 @@ local function milter_headers(task)
     end
 
 
-    if settings.extended_headers_rcpt and match_extended_headers_rcpt() then
-      return false
-    end
-
     if settings.skip_local and not settings.local_headers[hdr] then
       local ip = task:get_ip()
       if (ip and ip:is_local()) then return true end
@@ -171,6 +167,10 @@ local function milter_headers(task)
       if task:get_user() ~= nil then return true end
     end
 
+    if settings.extended_headers_rcpt and not match_extended_headers_rcpt() then
+      return true
+    end
+
     return false
 
   end