summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-01-10 20:36:00 +0600
committerGitHub <noreply@github.com>2024-01-10 20:36:00 +0600
commit2e2aab12026b0cbd401a364a888d6ecdd5f8d5db (patch)
tree69030d64a0176ab3bf96ac08d9d77c6faa8197bb
parente9aa6550177993b54fb168fa535bb8a881001bcc (diff)
parentc55e935c94acf43c0924317067b5ebf11567f904 (diff)
downloadrspamd-2e2aab12026b0cbd401a364a888d6ecdd5f8d5db.tar.gz
rspamd-2e2aab12026b0cbd401a364a888d6ecdd5f8d5db.zip
Merge pull request #4772 from fatalbanana/dmarc_pingpong
[Feature] Support suppressing DMARC reporting for particular recipients
-rw-r--r--src/plugins/lua/dmarc.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 99fede96a..792672bd0 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -267,7 +267,14 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld)
if settings.reporting.exclude_domains then
if settings.reporting.exclude_domains:get_key(policy.domain) or
settings.reporting.exclude_domains:get_key(rspamd_util.get_tld(policy.domain)) then
- rspamd_logger.infox(task, 'DMARC reporting suppressed for %s', policy.domain)
+ rspamd_logger.info(task, 'DMARC reporting suppressed for sender domain %s', policy.domain)
+ return
+ end
+ end
+ if settings.reporting.exclude_recipients then
+ local rcpt = task:get_principal_recipient()
+ if rcpt and settings.reporting.exclude_recipients:get_key(rcpt) then
+ rspamd_logger.info(task, 'DMARC reporting suppressed for recipient %s', rcpt)
return
end
end
@@ -515,6 +522,11 @@ if type(settings.reporting) == 'table' then
type = 'map',
description = 'Domains not to store DMARC reports about'
},
+ exclude_recipients = {
+ optional = true,
+ type = 'map',
+ description = 'Recipients not to store DMARC reports for'
+ },
})
end