mirror of
https://github.com/Mailu/Mailu.git
synced 2025-04-25 12:15:02 +02:00
Merge #2179
2179: Fix resolver r=mergify[bot] a=nextgens ## What type of PR? bug-fix ## What does this PR do? Switch to the new API to solve a k8s specific problem ### Related issue(s) - #2177 Co-authored-by: Florent Daigniere <nextgens@freenetproject.org> Co-authored-by: Billy Chan <shing@PC1>
This commit is contained in:
commit
d3db047fcc
@ -324,7 +324,7 @@ class Domain(Base):
|
||||
hostnames = set(app.config['HOSTNAMES'].split(','))
|
||||
return any(
|
||||
rset.exchange.to_text().rstrip('.') in hostnames
|
||||
for rset in dns.resolver.query(self.name, 'MX')
|
||||
for rset in dns.resolver.resolve(self.name, 'MX')
|
||||
)
|
||||
except dns.exception.DNSException:
|
||||
return False
|
||||
|
@ -52,7 +52,7 @@ resolver.flags = dns.flags.AD | dns.flags.RD
|
||||
|
||||
def has_dane_record(domain, timeout=10):
|
||||
try:
|
||||
result = resolver.query(f'_25._tcp.{domain}', dns.rdatatype.TLSA,dns.rdataclass.IN, lifetime=timeout)
|
||||
result = resolver.resolve(f'_25._tcp.{domain}', dns.rdatatype.TLSA,dns.rdataclass.IN, lifetime=timeout)
|
||||
if result.response.flags & dns.flags.AD:
|
||||
for record in result:
|
||||
if isinstance(record, dns.rdtypes.ANY.TLSA.TLSA):
|
||||
|
Loading…
x
Reference in New Issue
Block a user