Fixed validate_email not accepting catchalls (empty local part of the address)

This commit is contained in:
Jonas Platte 2014-07-12 03:19:09 +02:00
parent fb357dee33
commit 70e4e7f7be
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ def validate_email(email, strict):
# these characters are permitted in email address.
ATEXT = r'[\w!#$%&\'\*\+\-/=\?\^`\{\|\}~]' # see 3.2.4
DOT_ATOM_TEXT = ATEXT + r'+(?:\.' + ATEXT + r'+)*' # see 3.2.4
DOT_ATOM_TEXT = ATEXT + r'*(?:\.' + ATEXT + r'+)*' # see 3.2.4
DOT_ATOM_TEXT2 = ATEXT + r'+(?:\.' + ATEXT + r'+)+' # as above, but with a "+" since the host part must be under some TLD
ADDR_SPEC = '^%s@%s$' % (DOT_ATOM_TEXT, DOT_ATOM_TEXT2) # see 3.4.1