dhyey35 / php-email-address-validation

Automatically exported from code.google.com/p/php-email-address-validation
0 stars 0 forks source link

Quoted (\@) Characters Not Accepted #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The local portion of the email address does not accept single quoted 
characters (\@), only those enclosed in quote marks.

Original issue reported on code.google.com by addedby...@gmail.com on 17 Jul 2008 at 7:01

GoogleCodeExporter commented 9 years ago
That's because a quoted pair is not allowed in a dot-atom local-part. Quoted 
pairs 
are only allowed in quoted strings.

From RFC 5322:

local-part      =   dot-atom / quoted-string / obs-local-part

dot-atom        =   [CFWS] dot-atom-text [CFWS]

dot-atom-text   =   1*atext *("." 1*atext)

atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
                       "!" / "#" /        ;  characters not including
                       "$" / "%" /        ;  specials.  Used for atoms.
                       "&" / "'" /
                       "*" / "+" /
                       "-" / "/" /
                       "=" / "?" /
                       "^" / "_" /
                       "`" / "{" /
                       "|" / "}" /
                       "~"

obs-local-part  =   word *("." word)

word            =   atom / quoted-string

The mention of a quoted pair without being part of a quoted string was in RFC 
3696, 
and was wrong (hence corrected in the Errata).

Original comment by mikerushton@hotmail.co.uk on 2 Feb 2010 at 3:22