aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/rspamadm
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-05 21:05:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-08-05 21:06:14 +0100
commit0f57c944b0338b51a3cb6c37b8fa84508f75f8a9 (patch)
treeab58a091057783a92e64ec807a83c40a5d029df0 /lualib/rspamadm
parent00175f9b9ba2376de8969d72a734004838afc53c (diff)
downloadrspamd-0f57c944b0338b51a3cb6c37b8fa84508f75f8a9.tar.gz
rspamd-0f57c944b0338b51a3cb6c37b8fa84508f75f8a9.zip
[Minor] Dmarc_report: fix report domain check for 3rd party domains
Diffstat (limited to 'lualib/rspamadm')
-rw-r--r--lualib/rspamadm/dmarc_report.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lualib/rspamadm/dmarc_report.lua b/lualib/rspamadm/dmarc_report.lua
index fcc4f5e7f..d9ae40e99 100644
--- a/lualib/rspamadm/dmarc_report.lua
+++ b/lualib/rspamadm/dmarc_report.lua
@@ -303,13 +303,13 @@ local function process_rua(reporting_domain, rua)
local u = rspamd_url.create(pool, a:gsub('!%d+[kmg]?$', ''))
if u then
-- Check each address for sanity
- if u:get_tld() == reporting_domain then
+ if reporting_domain == u:get_tld() or reporting_domain == u:get_host() then
-- Same domain - always include
table.insert(addrs, u)
else
-- We need to check authority
local resolve_str = string.format('%s._report._dmarc.%s',
- reporting_domain, u:get_tld())
+ reporting_domain, u:get_host())
local is_ok, results = rspamd_dns.request({
config = rspamd_config,
session = rspamadm_session,
@@ -318,7 +318,7 @@ local function process_rua(reporting_domain, rua)
})
if not is_ok then
- logger.errx('cannot resolve %s: %s; exclude %s', reporting_domain, results, a)
+ logger.errx('cannot resolve %s: %s; exclude %s', resolve_str, results, a)
else
local found = false
for _,t in ipairs(results) do
@@ -357,7 +357,7 @@ local function validate_reporting_domain(reporting_domain)
name = '_dmarc.' .. reporting_domain ,
})
- if not is_ok then
+ if not is_ok or not results then
logger.errx('cannot resolve _dmarc.%s: %s', reporting_domain, results)
return nil
end