Rasmus Lerdorf:
> The ABNF for an HTML5 valid email field is:
> 
>   1*( atext / "." ) "@" ldh-str 1*( "." ldh-str )
> 
> which means there must be a . in the domain part, so HTML5 doesn't think
> a...@b is valid either.  The left-hand side looks wrong though.  It seems
> to me it should be:
> 
>   1*atext *("." 1*atext)
> 
> You can't have a trailing . there.  rasm...@php.net is not valid and if
> I am reading that HTML5 ABNF correctly it would seem to allow that.

The Internet mail RFCs don't allow a leading or trailing "dot"  in
the local-part (they do allow it when the local-part is quoted).

This is a fragment from RFC5321 (SMTP):

   Mailbox        = Local-part "@" ( Domain / address-literal )

   Local-part     = Dot-string / Quoted-string
                  ; MAY be case-sensitive

   Dot-string     = Atom *("."  Atom)

   Atom           = 1*atext

The corresponding part of RFC5322 (Internet Message Format) says:

   addr-spec       =   local-part "@" domain

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

   atom            =   [CFWS] 1*atext [CFWS]

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

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

I.e. both agree in their own way.

        Wietse

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to