mirror of
https://github.com/chatmail/relay.git
synced 2026-05-10 16:04:37 +00:00
don't do PTR reverse checking
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user