From ab3fe8a6267b5aee4ea7da35801c52a24f7e46bc Mon Sep 17 00:00:00 2001 From: Son NK Date: Thu, 2 Jan 2020 22:22:09 +0100 Subject: [PATCH] Flash errors when MX, SPF or DKIM fail --- app/dashboard/views/domain_detail.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/dashboard/views/domain_detail.py b/app/dashboard/views/domain_detail.py index c0557c26..88bcf98b 100644 --- a/app/dashboard/views/domain_detail.py +++ b/app/dashboard/views/domain_detail.py @@ -34,6 +34,7 @@ def domain_detail_dns(custom_domain_id): mx_domains = get_mx_domains(custom_domain.domain) if sorted(mx_domains) != sorted(EMAIL_SERVERS_WITH_PRIORITY): + flash("The MX record is not correctly set", "warning") mx_ok = False # build mx_errors to show to user mx_errors = [ @@ -63,7 +64,10 @@ def domain_detail_dns(custom_domain_id): ) ) else: - flash(f"{EMAIL_DOMAIN} is not included in your SPF record.", "warning") + flash( + f"SPF: {EMAIL_DOMAIN} is not included in your SPF record.", + "warning", + ) spf_ok = False spf_errors = get_txt_record(custom_domain.domain) @@ -81,6 +85,7 @@ def domain_detail_dns(custom_domain_id): ) ) else: + flash("DKIM: the TXT record is not correctly set", "warning") dkim_ok = False dkim_errors = get_txt_record(f"dkim._domainkey.{custom_domain.domain}")