From 483443804255bfe114b6a351650ce3335e808459 Mon Sep 17 00:00:00 2001 From: Jaume Martin Date: Sun, 27 Aug 2017 20:24:15 +0200 Subject: [PATCH 1/5] Update .env.dist --- .env.dist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.env.dist b/.env.dist index 1a1f3b67..84eabf28 100644 --- a/.env.dist +++ b/.env.dist @@ -29,6 +29,10 @@ HOSTNAME=mail.mailu.io # Postmaster local part (will append the main mail domain) POSTMASTER=admin +# DMARC rua and ruf email +DMARC_RUA=admin +DMARC_RUF=admin + # Docker-compose project name, this will prepended to containers names. COMPOSE_PROJECT_NAME=mailu From 5b6cba3b9e1051f4c68459b94b6cec97e1981f05 Mon Sep 17 00:00:00 2001 From: Jaume Martin Date: Sun, 27 Aug 2017 20:29:04 +0200 Subject: [PATCH 2/5] Update details.html --- admin/mailu/admin/templates/domain/details.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/admin/mailu/admin/templates/domain/details.html b/admin/mailu/admin/templates/domain/details.html index 9a98f944..ba77201f 100644 --- a/admin/mailu/admin/templates/domain/details.html +++ b/admin/mailu/admin/templates/domain/details.html @@ -42,7 +42,15 @@ {% trans %}DNS DMARC entry{% endtrans %} + {% if config["DMARC_RUA"] != "" and config["DMARC_RUF"] != "" %} +
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["DMARC_RUA"] }}@{{ config["DOMAIN"] }}; ruf=mailto:{{ config["DMARC_RUF"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
+ {% elif config["DMARC_RUA"] != "" %} +
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["DMARC_RUA"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
+ {% elif config["DMARC_RUF"] != "" %} +
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; ruf=mailto:{{ config["DMARC_RUF"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
+ {% else %}
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["POSTMASTER"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
+ {% endif %} {% endif %} From d90b7444c826265384bc96601426154ca7394192 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sun, 10 Sep 2017 19:28:59 +0200 Subject: [PATCH 3/5] Move settings to the email section --- .env.dist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.dist b/.env.dist index 7393474f..58bfc145 100644 --- a/.env.dist +++ b/.env.dist @@ -29,10 +29,6 @@ HOSTNAME=mail.mailu.io # Postmaster local part (will append the main mail domain) POSTMASTER=admin -# DMARC rua and ruf email -DMARC_RUA=admin -DMARC_RUF=admin - # Docker-compose project name, this will prepended to containers names. COMPOSE_PROJECT_NAME=mailu @@ -81,6 +77,10 @@ FETCHMAIL_DELAY=600 # e.g. localpart+custom@domain;tld RECIPIENT_DELIMITER=+ +# DMARC rua and ruf email +DMARC_RUA=admin +DMARC_RUF=admin + ################################### # Nginx settings ################################### From 9754fffbc410706d41ce33baa5bac3747608eb9c Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sun, 10 Sep 2017 19:35:31 +0200 Subject: [PATCH 4/5] Simplify the details page for RUA/RUF --- admin/mailu/admin/templates/domain/details.html | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/admin/mailu/admin/templates/domain/details.html b/admin/mailu/admin/templates/domain/details.html index ba77201f..1ae45e16 100644 --- a/admin/mailu/admin/templates/domain/details.html +++ b/admin/mailu/admin/templates/domain/details.html @@ -42,15 +42,7 @@ {% trans %}DNS DMARC entry{% endtrans %} - {% if config["DMARC_RUA"] != "" and config["DMARC_RUF"] != "" %} -
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["DMARC_RUA"] }}@{{ config["DOMAIN"] }}; ruf=mailto:{{ config["DMARC_RUF"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
- {% elif config["DMARC_RUA"] != "" %} -
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["DMARC_RUA"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
- {% elif config["DMARC_RUF"] != "" %} -
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; ruf=mailto:{{ config["DMARC_RUF"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
- {% else %} -
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject; rua=mailto:{{ config["POSTMASTER"] }}@{{ config["DOMAIN"] }}; adkim=s; aspf=s"
- {% endif %} +
_dmarc.{{ domain.name }}. 600 IN TXT "v=DMARC1; p=reject;{% if config["DMARC_RUA"] %} rua=mailto:{{ config["DMARC_RUA"] }}@{{ config["DOMAIN"] }};{% endif %}{% if config["DMARC_RUF"] %} ruf=mailto:{{ config["DMARC_RUF"] }}@{{ config["DOMAIN"] }};{% endif %} adkim=s; aspf=s"
{% endif %} From 03b352cbcd857dc748f05e2ea3ce592ee22b180c Mon Sep 17 00:00:00 2001 From: kaiyou Date: Sun, 10 Sep 2017 19:35:43 +0200 Subject: [PATCH 5/5] Declare the DMARC RUA/RUF configuration items --- admin/mailu/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/mailu/__init__.py b/admin/mailu/__init__.py index aeb4d89e..d09bb889 100644 --- a/admin/mailu/__init__.py +++ b/admin/mailu/__init__.py @@ -27,6 +27,8 @@ default_config = { 'BOOTSTRAP_SERVE_LOCAL': True, 'DKIM_PATH': '/dkim/{domain}.{selector}.key', 'DKIM_SELECTOR': 'dkim', + 'DMARC_RUA': None, + 'DMARC_RUF': None, 'BABEL_DEFAULT_LOCALE': 'en', 'BABEL_DEFAULT_TIMEZONE': 'UTC', 'ENABLE_CERTBOT': False,