diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-07-25 19:10:46 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 19:10:46 +0600 |
commit | 5c6146798e73ef38f08fbc1dab7c4dcd452a6cd0 (patch) | |
tree | 99b1b3a34321861cb205aa022f9ad6039f3130fc | |
parent | b553c0c29eb136d1bd33fce3cfc0265d7909fe0c (diff) | |
parent | a6a7695e71fad5e29fa499817b9109d4ed27304d (diff) | |
download | rspamd-5c6146798e73ef38f08fbc1dab7c4dcd452a6cd0.tar.gz rspamd-5c6146798e73ef38f08fbc1dab7c4dcd452a6cd0.zip |
Merge pull request #4960 from JasonStephenson/bugfix/arc-regex-fix
[FIX] Arc regex to no longer match on dmarc=
-rw-r--r-- | src/plugins/lua/arc.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua index ff19aef4c..90e254e78 100644 --- a/src/plugins/lua/arc.lua +++ b/src/plugins/lua/arc.lua @@ -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 |