diff --git a/CHANGELOG.md b/CHANGELOG.md index c0da524f..bd323818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## untagged +- remove checking of reverse-DNS PTR records. Chatmail-servers don't + depend on it and even in the wider e-mail system it's not common anymore. + If it's an issue, a chatmail operator can still care to properly set reverse DNS. + ([#348](https://github.com/deltachat/chatmail/pull/348)) + - Make DNS-checking faster and more interactive, run it fully during "cmdeploy run", also introducing a generic mechanism for rapid remote ssh-based python function execution. ([#346](https://github.com/deltachat/chatmail/pull/346)) diff --git a/cmdeploy/src/cmdeploy/dns.py b/cmdeploy/src/cmdeploy/dns.py index fbc213a9..ba6303ad 100644 --- a/cmdeploy/src/cmdeploy/dns.py +++ b/cmdeploy/src/cmdeploy/dns.py @@ -47,7 +47,8 @@ def show_dns(args, out) -> int: 0, "You should configure the following entries at your DNS provider:\n" ) to_print.append( - "\nIf you already configured the DNS entries, wait a bit until the DNS entries propagate to the Internet." + "\nIf you already configured the DNS entries, " + "wait a bit until the DNS entries propagate to the Internet." ) out.red("\n".join(to_print)) exit_code = 1 @@ -55,17 +56,4 @@ def show_dns(args, out) -> int: out.green("Great! All your DNS entries are verified and correct.") exit_code = 0 - to_print = [] - if not remote_data["reverse_ipv4"]: - to_print.append(f"\tIPv4:\t{remote_data['ipv4']}\t{args.config.mail_domain}") - if not remote_data["reverse_ipv6"]: - to_print.append(f"\tIPv6:\t{remote_data['ipv6']}\t{args.config.mail_domain}") - if len(to_print) > 0: - out.red("You need to set the following PTR/reverse DNS data:") - for entry in to_print: - print(entry) - out.red( - "You can do so at your hosting provider (maybe this isn't your DNS provider)." - ) - return exit_code, remote_data diff --git a/cmdeploy/src/cmdeploy/remote_funcs.py b/cmdeploy/src/cmdeploy/remote_funcs.py index 80a88644..1cc5763e 100644 --- a/cmdeploy/src/cmdeploy/remote_funcs.py +++ b/cmdeploy/src/cmdeploy/remote_funcs.py @@ -38,11 +38,8 @@ def perform_initial_checks(mail_domain): shell(f"unbound-control flush_zone {mail_domain}", fail_ok=True) res["dkim_entry"] = get_dkim_entry(mail_domain, dkim_selector="opendkim") - - ipv4, reverse_ipv4 = get_ip_address_and_reverse(socket.AF_INET) - ipv6, reverse_ipv6 = get_ip_address_and_reverse(socket.AF_INET6) - res.update(dict(ipv4=ipv4, reverse_ipv4=reverse_ipv4)) - res.update(dict(ipv6=ipv6, reverse_ipv6=reverse_ipv6)) + res["ipv4"] = get_ip_address(socket.AF_INET) + res["ipv6"] = get_ip_address(socket.AF_INET6) return res @@ -56,12 +53,11 @@ def get_dkim_entry(mail_domain, dkim_selector): return f'{dkim_selector}._domainkey.{mail_domain}. TXT "{dkim_value}"' -def get_ip_address_and_reverse(typ): +def get_ip_address(typ): sock = socket.socket(typ, socket.SOCK_DGRAM) sock.settimeout(0) sock.connect(("notifications.delta.chat", 1)) - ip = sock.getsockname()[0] - return ip, shell(f"dig -r -x {ip} +short").rstrip(".") + return sock.getsockname()[0] def query_dns(typ, domain):