Added requirements.txt
This commit is contained in:
parent
a110914328
commit
29dde38a84
|
@ -15,15 +15,14 @@ def get_mx_records(domain):
|
|||
return [str(x.exchange) for x in records]
|
||||
|
||||
|
||||
def mx_check(email_address):
|
||||
def mx_check(email_address, timeout=10):
|
||||
host = socket.gethostname()
|
||||
|
||||
smtp = smtplib.SMTP()
|
||||
smtp = smtplib.SMTP(timeout=timeout)
|
||||
smtp.set_debuglevel(0)
|
||||
|
||||
domain = get_domain_from_email_address(email_address)
|
||||
mx_records = get_mx_records(domain)
|
||||
print(mx_records)
|
||||
|
||||
for mx_record in mx_records:
|
||||
smtp.connect(mx_record)
|
||||
|
|
|
@ -34,4 +34,4 @@ def validate_email(
|
|||
if not check_mx:
|
||||
return True
|
||||
|
||||
return mx_check(email_address)
|
||||
return mx_check(email_address, timeout=smtp_timeout)
|
|
@ -0,0 +1 @@
|
|||
dnspython
|
|
@ -1,3 +1,6 @@
|
|||
[nosetests]
|
||||
verbosity=3
|
||||
with-doctest=1
|
||||
|
||||
[metadata]
|
||||
description-file = README.rst
|
||||
|
|
Loading…
Reference in New Issue