aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-06-15 16:12:23 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-06-15 16:12:23 +0200
commit41ac6b23235a61532b04340dd651c1659fb4066b (patch)
treec1f58b053e03a4d1d99b068c3030feff063c1011 /src/plugins
parent7c7256d940fc78d4defe83c1a1e79ad766f2b4c9 (diff)
downloadrspamd-41ac6b23235a61532b04340dd651c1659fb4066b.tar.gz
rspamd-41ac6b23235a61532b04340dd651c1659fb4066b.zip
[Feature] Support suppressing DMARC reports for some domains
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/dmarc.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 04382c00b..72a04866e 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -33,6 +33,7 @@ end
local N = 'dmarc'
local no_sampling_domains
+local no_reporting_domains
local statefile = string.format('%s/%s', rspamd_paths['DBDIR'], 'dmarc_reports_last_sent')
local VAR_NAME = 'dmarc_reports_last_sent'
local INTERVAL = 86400
@@ -515,6 +516,13 @@ local function dmarc_callback(task)
if rua and redis_params and dmarc_reporting then
+ if no_reporting_domains then
+ if no_reporting_domains:get_key(dmarc_domain) or no_reporting_domains:get_key(rspamd_util.get_tld(dmarc_domain)) then
+ rspamd_logger.infox(task, 'DMARC reporting suppressed for %1', dmarc_domain)
+ return maybe_force_action(disposition)
+ end
+ end
+
local spf_result
if spf_ok then
spf_result = 'pass'
@@ -597,6 +605,7 @@ if not opts or type(opts) ~= 'table' then
return
end
no_sampling_domains = rspamd_map_add(N, 'no_sampling_domains', 'map', 'Domains not to apply DMARC sampling to')
+no_reporting_domains = rspamd_map_add(N, 'no_reporting_domains', 'map', 'Domains not to apply DMARC reporting to')
if opts['symbols'] then
for k,_ in pairs(dmarc_symbols) do