mirror of
https://github.com/aljazceru/validate_email.git
synced 2025-12-19 15:14:18 +01:00
whitespace throws regex failure and check for servfail
This commit is contained in:
@@ -51,7 +51,7 @@ except (ImportError, AttributeError):
|
||||
# even when it's not strictly necessary. This way we don't forget
|
||||
# when it is necessary.)
|
||||
#
|
||||
WSP = r'[ \t]' # see 2.2.2. Structured Header Field Bodies
|
||||
WSP = r'[\s]' # see 2.2.2. Structured Header Field Bodies
|
||||
CRLF = r'(?:\r\n)' # see 2.2.3. Long Header Fields
|
||||
NO_WS_CTL = r'\x01-\x08\x0b\x0c\x0f-\x1f\x7f' # see 3.2.1. Primitive Tokens
|
||||
QUOTED_PAIR = r'(?:\\.)' # see 3.2.2. Quoted characters
|
||||
@@ -101,7 +101,7 @@ def get_mx_ip(hostname):
|
||||
try:
|
||||
MX_DNS_CACHE[hostname] = DNS.mxlookup(hostname)
|
||||
except ServerError as e:
|
||||
if e.rcode == 3: # NXDOMAIN (Non-Existent Domain)
|
||||
if e.rcode == 3 or e.rcode == 2: # NXDOMAIN (Non-Existent Domain) or SERVFAIL
|
||||
MX_DNS_CACHE[hostname] = None
|
||||
else:
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user