dns: check mta-sts CNAME directly without resolving to IP

This commit is contained in:
link2xt 2024-01-06 18:20:53 +00:00
parent b6622fc68e
commit c39a79e26a

View File

@ -183,13 +183,10 @@ def check_necessary_dns(out, mail_domain):
ipv4 = dns.get("A", mail_domain)
ipv6 = dns.get("AAAA", mail_domain)
mta_entry = dns.get("CNAME", "mta-sts." + mail_domain)
mta_ip = dns.get("A", mta_entry)
if not mta_ip:
mta_ip = dns.get("AAAA", mta_entry)
to_print = []
if not (ipv4 or ipv6):
to_print.append(f"\t{mail_domain}.\t\t\tA<your server's IPv4 address>")
if not mta_ip or not (mta_ip == ipv4 or mta_ip == ipv6):
if mta_entry != mail_domain + ".":
to_print.append(f"\tmta-sts.{mail_domain}.\tCNAME\t{mail_domain}.")
if to_print:
to_print.insert(