From c39a79e26a1932f63989bac7809aaca14bebfffe Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 6 Jan 2024 18:20:53 +0000 Subject: [PATCH] dns: check mta-sts CNAME directly without resolving to IP --- cmdeploy/src/cmdeploy/dns.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmdeploy/src/cmdeploy/dns.py b/cmdeploy/src/cmdeploy/dns.py index 4f2af9b..60d78f5 100644 --- a/cmdeploy/src/cmdeploy/dns.py +++ b/cmdeploy/src/cmdeploy/dns.py @@ -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") - 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(