1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-22 07:17:05 +00:00

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

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