mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Stop using deprecated dnspython method
This commit is contained in:
@@ -44,7 +44,7 @@ logger = logging.getLogger(__name__)
|
|||||||
def get_spf_record(hostname):
|
def get_spf_record(hostname):
|
||||||
try:
|
try:
|
||||||
r = dns.resolver.Resolver()
|
r = dns.resolver.Resolver()
|
||||||
for resp in r.query(hostname, 'TXT'):
|
for resp in r.resolve(hostname, 'TXT'):
|
||||||
data = b''.join(resp.strings).decode()
|
data = b''.join(resp.strings).decode()
|
||||||
if data.lower().strip().startswith('v=spf1 '): # RFC7208, section 4.5
|
if data.lower().strip().startswith('v=spf1 '): # RFC7208, section 4.5
|
||||||
return data
|
return data
|
||||||
|
|||||||
Reference in New Issue
Block a user