From b7fb8c661acd639c4101acbd039c1ea9a21fa114 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Fri, 21 Jan 2022 14:52:57 +0100 Subject: [PATCH 1/3] switch to new API --- core/admin/mailu/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/admin/mailu/utils.py b/core/admin/mailu/utils.py index cae8fab8..f0a7fd20 100644 --- a/core/admin/mailu/utils.py +++ b/core/admin/mailu/utils.py @@ -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): From b9e614145febe6de5022671e90c589216b19fd61 Mon Sep 17 00:00:00 2001 From: Florent Daigniere Date: Fri, 21 Jan 2022 15:01:23 +0100 Subject: [PATCH 3/3] there too --- core/admin/mailu/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py index 987a1ad9..920008fd 100644 --- a/core/admin/mailu/models.py +++ b/core/admin/mailu/models.py @@ -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