From a13598d1bcfc662cd3e96cffcfa78bbd4fdbd76c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20R=C3=B6=C3=9Fner?= Date: Thu, 2 Oct 2025 17:53:51 +0200 Subject: [PATCH] Feat: Added rua address exclusion in dmarc.lua Added a new configuration option exclude_rua_addresses in the dmarc reporting section. See #5220 --- src/plugins/lua/dmarc.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 630bb6bbda..cc1a67661c 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -284,6 +284,13 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld) return end end + if policy.rua:match("^mailto:") and settings.reporting.exclude_rua_addresses then + local rua = policy.rua:gsub("^mailto:", "") + if settings.reporting.exclude_rua_addresses:get_key(rua) then + rspamd_logger.info(task, 'DMARC reporting suppressed for rua recipient %s', rua) + return + end + end local function dmarc_report_cb(err) if not err then @@ -533,6 +540,11 @@ if type(settings.reporting) == 'table' then type = 'map', description = 'Recipients not to store DMARC reports for' }, + exclude_rua_addresses = { + optional = true, + type = 'map', + description = 'RUA recipients not to store DMARC reports for' + }, only_domains = { optional = true, type = 'map', -- 2.47.3