From 2c8de18a80a603e4f0ef4d9ed167a74e5d22f040 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 22 Mar 2018 16:17:11 +0800 Subject: dns/zones: improve dmarc record --- roles/dns/templates/zones/aaronly.me.zone.j2 | 9 ++++++++- roles/dns/templates/zones/liwt.net.zone.j2 | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'roles/dns') diff --git a/roles/dns/templates/zones/aaronly.me.zone.j2 b/roles/dns/templates/zones/aaronly.me.zone.j2 index da4814e..4a25d00 100644 --- a/roles/dns/templates/zones/aaronly.me.zone.j2 +++ b/roles/dns/templates/zones/aaronly.me.zone.j2 @@ -38,7 +38,14 @@ mail IN CNAME mail.{{ network.domain }}. {% endif %} @ IN TXT "v=spf1 mx -all" @ IN TXT "google-site-verification={{ mail['google-site-verification'][domain] }}" -_dmarc IN TXT "v=DMARC1; p={{ mail.dmarc.p }}; sp={{ mail.dmarc.sp }}; pct={{ mail.dmarc.pct }}; aspf={{ mail.dmarc.aspf }}; rua=mailto:{{ mail.dmarc.rua[domain] }};" +{% set ruatxt = "rua=mailto:" + mail.dmarc.rua[domain] + ";" %} +{% set ruf = mail.dmarc.ruf | default({}) %} +{% if ruf[domain] is defined %} +{% set ruftxt = "ruf=mailto:" + ruf[domain] + ";" %} +{% else %} +{% set ruftxt = "" %} +{% endif %} +_dmarc IN TXT "v=DMARC1; p={{ mail.dmarc.p }}; sp={{ mail.dmarc.sp }}; pct={{ mail.dmarc.pct }}; adkim={{ mail.dmarc.adkim }}; aspf={{ mail.dmarc.aspf }}; fo={{ mail.dmarc.fo }}; {{ ruatxt }} {{ ruftxt }}" {% if domain_key is defined %} {{ domain_key | dkim_record(selector=mail.dkim.selector) | join("\n") }} {% endif %} diff --git a/roles/dns/templates/zones/liwt.net.zone.j2 b/roles/dns/templates/zones/liwt.net.zone.j2 index bbd7d14..03459ee 100644 --- a/roles/dns/templates/zones/liwt.net.zone.j2 +++ b/roles/dns/templates/zones/liwt.net.zone.j2 @@ -46,7 +46,14 @@ mail IN AAAA {{ network.ipv6.address }} {% endif %} @ IN TXT "v=spf1 mx -all" @ IN TXT "google-site-verification={{ mail['google-site-verification'][domain] }}" -_dmarc IN TXT "v=DMARC1; p={{ mail.dmarc.p }}; sp={{ mail.dmarc.sp }}; pct={{ mail.dmarc.pct }}; aspf={{ mail.dmarc.aspf }}; rua=mailto:{{ mail.dmarc.rua[domain] }};" +{% set ruatxt = "rua=mailto:" + mail.dmarc.rua[domain] + ";" %} +{% set ruf = mail.dmarc.ruf | default({}) %} +{% if ruf[domain] is defined %} +{% set ruftxt = "ruf=mailto:" + ruf[domain] + ";" %} +{% else %} +{% set ruftxt = "" %} +{% endif %} +_dmarc IN TXT "v=DMARC1; p={{ mail.dmarc.p }}; sp={{ mail.dmarc.sp }}; pct={{ mail.dmarc.pct }}; adkim={{ mail.dmarc.adkim }}; aspf={{ mail.dmarc.aspf }}; fo={{ mail.dmarc.fo }}; {{ ruatxt }} {{ ruftxt }}" {% if domain_key is defined %} {{ domain_key | dkim_record(selector=mail.dkim.selector) | join("\n") }} {% endif %} -- cgit v1.2.2