From aea7680848e05ca16dd900e770f58cfae50040ea Mon Sep 17 00:00:00 2001 From: Jumper78 <52802286+Jumper78@users.noreply.github.com> Date: Fri, 14 Feb 2025 22:00:56 +0000 Subject: [PATCH] extended the zonefile to also include the dns entries of the alternative domains added the dmarc report dns entry also for the main domain --- core/admin/mailu/ui/views/domains.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/admin/mailu/ui/views/domains.py b/core/admin/mailu/ui/views/domains.py index a3b78204..1f12113c 100644 --- a/core/admin/mailu/ui/views/domains.py +++ b/core/admin/mailu/ui/views/domains.py @@ -81,8 +81,18 @@ 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) res.extend(domain.dns_tlsa) res.extend(domain.dns_autoconfig) + for alternative in domain.alternatives: + res.extend([alternative.dns_mx, alternative.dns_spf]) + if alternative.domain.dkim_publickey: + record = alternative.dns_dkim.split('"', 1)[0].strip() + txt = f'v=DKIM1; k=rsa; p={alternative.domain.dkim_publickey}' + 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) res.append("") return flask.Response( "\n".join(res),