Handle case where user followed the tutorial and set the CNAME reccord

for mta-sts, but no TXT record for it yet.
This commit is contained in:
Treefit
2025-11-28 09:34:44 +01:00
parent 96108bbaba
commit abb70a6b14

View File

@@ -37,7 +37,10 @@ def perform_initial_checks(mail_domain, pre_command=""):
return res
# parse out sts-id if exists, example: "v=STSv1; id=2090123"
parts = query_dns("TXT", f"_mta-sts.{mail_domain}").split("id=")
mta_sts_txt = query_dns("TXT", f"_mta-sts.{mail_domain}")
if not mta_sts_txt:
return res
parts = mta_sts_txt.split("id=")
res["sts_id"] = parts[1].rstrip('"') if len(parts) == 2 else ""
return res