aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Stephenson <jstephenson@mimecast.com>2024-07-23 16:12:28 +0100
committerJason Stephenson <jstephenson@mimecast.com>2024-07-23 16:12:28 +0100
commit42c4aa280f20aa66a7be5528da119a63fa0073d4 (patch)
treefc8d0c09ed57ed0cd6e7a405f81ce7d403420e55 /src
parent05eda3bb5a60014614a5eea3111bd5af994d716c (diff)
downloadrspamd-42c4aa280f20aa66a7be5528da119a63fa0073d4.tar.gz
rspamd-42c4aa280f20aa66a7be5528da119a63fa0073d4.zip
Use pattern to get all methodspecs + reasonspecs, and return the value of the arc one if present
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/arc.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index 1533655d5..98f9303fa 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -635,11 +635,22 @@ 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