﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2049	[patch] isValidEmail is too narrow	mir@…	Adrian Holovaty	"The validator for email addresses is defined using a regular expression:

{{{
email_re = re.compile(r'^[A-Z0-9._%-][+A-Z0-9._%-]*@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$', re.IGNORECASE)
}}}

This is too narrow. RFC 2822 defines

{{{

(3.2.4)

atext           =       ALPHA / DIGIT / ; Any character except controls,
                        ""!"" / ""#"" /     ;  SP, and specials.
                        ""$"" / ""%"" /     ;  Used for atoms
                        ""&"" / ""'"" /
                        ""*"" / ""+"" /
                        ""-"" / ""/"" /
                        ""="" / ""?"" /
                        ""^"" / ""_"" /
                        ""`"" / ""{"" /
                        ""|"" / ""}"" /
                        ""~""

atom            =       [CFWS] 1*atext [CFWS]

dot-atom        =       [CFWS] dot-atom-text [CFWS]

dot-atom-text   =       1*atext *(""."" 1*atext)

(3.4.1)

addr-spec       =       local-part ""@"" domain

local-part      =       dot-atom / quoted-string / obs-local-part

}}}

This boild down to {{{[-.!#$%&'*+/=?^_`{}|~0-9A-Z]+}}} for the localpart, if you ignore quoted-string and obs-local-part.
"	defect	closed	Validators	dev	normal	fixed			Unreviewed	1	0	0	0	0	0
