From a5d27836048202f0ee8661d498afc3ec46166f4a Mon Sep 17 00:00:00 2001 From: Jumper78 <52802286+Jumper78@users.noreply.github.com> Date: Sun, 16 Feb 2025 21:26:34 +0000 Subject: [PATCH] added functionality that DNS DMARC entry for report is only shown when needed also to zonefile --- core/admin/mailu/ui/views/domains.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/admin/mailu/ui/views/domains.py b/core/admin/mailu/ui/views/domains.py index 1f12113c..17641fdc 100644 --- a/core/admin/mailu/ui/views/domains.py +++ b/core/admin/mailu/ui/views/domains.py @@ -81,7 +81,8 @@ def domain_download_zonefile(domain_name): txt = ' '.join(f'"{txt[p:p+250]}"' for p in range(0, len(txt), 250)) res.append(f'{record} {txt}') res.append(domain.dns_dmarc) - res.append(domain.dns_dmarc_report) + if domain.dns_dmarc_report_needed: + res.append(domain.dns_dmarc_report) res.extend(domain.dns_tlsa) res.extend(domain.dns_autoconfig) for alternative in domain.alternatives: @@ -92,7 +93,8 @@ def domain_download_zonefile(domain_name): txt = ' '.join(f'"{txt[p:p+250]}"' for p in range(0, len(txt), 250)) res.append(f'{record} {txt}') res.append(alternative.dns_dmarc) - res.append(alternative.dns_dmarc_report) + if alternative.dns_dmarc_report_needed: + res.append(alternative.dns_dmarc_report) res.append("") return flask.Response( "\n".join(res),