1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-18 03:21:36 +02:00

remove the error variable

This commit is contained in:
Florent Daigniere 2022-01-12 13:34:18 +01:00 committed by GitHub
parent b12616b93f
commit a2f6243382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,17 +33,15 @@ def test_DNS():
nameservers = resolver.nameservers nameservers = resolver.nameservers
for ns in nameservers: for ns in nameservers:
resolver.nameservers=[ns] resolver.nameservers=[ns]
error = True while True:
while error:
try: try:
result = resolver.query('example.org', dns.rdatatype.A, dns.rdataclass.IN, lifetime=10) result = resolver.query('example.org', dns.rdatatype.A, dns.rdataclass.IN, lifetime=10)
if not result.response.flags & dns.flags.AD:
log.critical("Your DNS resolver at %s isn't doing DNSSEC validation; Please use another resolver or enable unbound via https://setup.mailu.io.", ns)
else:
error = False
continue
except Exception as e: except Exception as e:
log.critical("Your DNS resolver at %s is not working (%s). Please use another resolver or enable unbound via https://setup.mailu.io.", ns, e); log.critical("Your DNS resolver at %s is not working (%s). Please use another resolver or enable unbound via https://setup.mailu.io.", ns, e);
elif result.response.flags & dns.flags.AD:
break
else:
log.critical("Your DNS resolver at %s isn't doing DNSSEC validation; Please use another resolver or enable unbound via https://setup.mailu.io.", ns)
time.sleep(5) time.sleep(5)
test_DNS() test_DNS()