]> source.dussan.org Git - rspamd.git/commitdiff
Merge pull request #4960 from JasonStephenson/bugfix/arc-regex-fix
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 25 Jul 2024 13:10:46 +0000 (19:10 +0600)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 10 Aug 2024 09:39:19 +0000 (10:39 +0100)
[FIX] Arc regex to no longer match on dmarc=

src/plugins/lua/arc.lua

index ff19aef4cee6537dbdc66068ffdbeed29cbf667c..90e254e788c21c78b8a5a040287825e0b307cf01 100644 (file)
@@ -635,11 +635,21 @@ local function prepare_arc_selector(task, sel)
       end
     end
 
+    local function arc_result_from_ar(ar_header)
+      ar_header = ar_header or ""
+      for k, v in string.gmatch(ar_header, "(%w+)=(%w+)") do
+        if k == 'arc' then
+         return v
+        end
+      end
+      return nil
+    end
+
     if settings.reuse_auth_results then
       local ar_header = task:get_header('Authentication-Results')
 
       if ar_header then
-        local arc_match = string.match(ar_header, 'arc=(%w+)')
+        local arc_match = arc_result_from_ar(ar_header)
 
         if arc_match then
           if arc_match == 'none' or arc_match == 'pass' then