diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2024-09-18 22:10:20 +0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-18 22:10:20 +0600 |
commit | 206195f2197631a3625a0c6b7d17eb55da86ce46 (patch) | |
tree | 4b6e70a6abd555a37cb87748eb1be82a3ce918b1 | |
parent | 986814257147e9e79df032f5f157d90c0ee430e4 (diff) | |
parent | 6540c486723618de1af662f0b1bb1b8f108fa7a6 (diff) | |
download | rspamd-206195f2197631a3625a0c6b7d17eb55da86ce46.tar.gz rspamd-206195f2197631a3625a0c6b7d17eb55da86ce46.zip |
Merge pull request #5142 from fatalbanana/dmarc_only_domains
[Feature] DMARC: Implement reporting.only_domains setting
-rw-r--r-- | src/plugins/lua/dmarc.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 792672bd0..28b3db867 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -264,6 +264,13 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld) end if policy.rua and redis_params and settings.reporting.enabled then + if settings.reporting.only_domains then + if not (settings.reporting.only_domains:get_key(policy.domain) or + settings.reporting.only_domains:get_key(rspamd_util.get_tld(policy.domain))) then + rspamd_logger.info(task, 'DMARC reporting suppressed for sender domain %s', policy.domain) + return + end + end 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 @@ -527,6 +534,11 @@ if type(settings.reporting) == 'table' then type = 'map', description = 'Recipients not to store DMARC reports for' }, + only_domains = { + optional = true, + type = 'map', + description = 'Domains to store DMARC reports about' + }, }) end |