diff --git a/management/whats_next.py b/management/whats_next.py index 051bd71f..a0113f0c 100755 --- a/management/whats_next.py +++ b/management/whats_next.py @@ -158,12 +158,17 @@ def check_dns_zone(domain, env, dns_zonefiles): print("") def check_mail_domain(domain, env): - # Check the MX record. - mx = query_dns(domain, "MX") + # Check the MX record. A missing MX record is okay on the primary hostname + # because the primary hostname's A record (the MX fallback) is... itself, + # which s what we want the MX to be. + mx = query_dns(domain, "MX", nxdomain=None) expected_mx = "10 " + env['PRIMARY_HOSTNAME'] if mx == expected_mx: print_ok("Domain's email is directed to this domain. [%s => %s]" % (domain, mx)) + elif mx == None and domain == env['PRIMARY_HOSTNAME']: + print_ok("Domain's email is directed to this domain. [%s has no MX record, which is ok]" % (domain,)) else: + if mx == None: mx = "[Not Set]" print_error("""This domain's DNS MX record is incorrect. It is currently set to '%s' but should be '%s'. Mail will not be delivered to this box. It may take several hours for public DNS to update after a change. This problem may result from other issues listed here.""" % (mx, expected_mx))