]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Feat: Added rua address exclusion in dmarc.lua 5653/head
authorChristian Rößner <c@roessner-network-solutions.com>
Thu, 2 Oct 2025 15:53:51 +0000 (17:53 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Oct 2025 15:53:51 +0000 (17:53 +0200)
Added a new configuration option exclude_rua_addresses in the dmarc reporting section.

See #5220

src/plugins/lua/dmarc.lua

index 630bb6bbda182b791fd7763bac2342a8cf9ccb4f..cc1a67661c1a31d4e47a153fbea339722313f3f4 100644 (file)
@@ -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',