summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2022-09-16 22:05:06 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2022-09-16 22:05:06 +0100
commitd39a5d31210e4223b5d7a9288bfdfd815fd805e6 (patch)
tree03c7eda1d9a56e987502c1b6abf999aa299c2a05 /src
parentaa419582649958cce55bdb25686ce7ef5abf8f08 (diff)
downloadrspamd-d39a5d31210e4223b5d7a9288bfdfd815fd805e6.tar.gz
rspamd-d39a5d31210e4223b5d7a9288bfdfd815fd805e6.zip
[Minor] Dmarc: Move `no_reporting_domains` to `reporting.exclude_domains`
This is done for consistency with provision of the backward compatibility
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/dmarc.lua26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 99d909154..17ef5c274 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -266,9 +266,9 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld)
end
if policy.rua and redis_params and settings.reporting.enabled then
- if settings.no_reporting_domains then
- if settings.no_reporting_domains:get_key(policy.domain) or
- settings.no_reporting_domains:get_key(rspamd_util.get_tld(policy.domain)) then
+ 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)
return
end
@@ -499,6 +499,11 @@ settings = lua_util.override_defaults(settings, opts)
settings.auth_and_local_conf = lua_util.config_check_local_or_authed(rspamd_config, N,
false, false)
+-- Legacy...
+if settings.reporting and not settings.reporting.exclude_domains and settings.no_reporting_domains then
+ settings.reporting.exclude_domains = settings.no_reporting_domains
+end
+
local lua_maps = require "lua_maps"
lua_maps.fill_config_maps(N, settings, {
no_sampling_domains = {
@@ -506,13 +511,18 @@ lua_maps.fill_config_maps(N, settings, {
type = 'map',
description = 'Domains not to apply DMARC sampling to'
},
- no_reporting_domains = {
- optional = true,
- type = 'map',
- description = 'Domains not to apply DMARC reporting to'
- },
})
+if type(settings.reporting) == 'table' then
+ lua_maps.fill_config_maps(N, settings.reporting, {
+ exclude_domains = {
+ optional = true,
+ type = 'map',
+ description = 'Domains not to store DMARC reports about'
+ },
+ })
+end
+
if settings.reporting == true then
rspamd_logger.errx(rspamd_config, 'old style dmarc reporting is NO LONGER supported, please read the documentation')