#8038: email address validator does not accept + in addresses
-------------------------+--------------------------------------------------
   Reporter:  ddrake     |       Owner:  was         
       Type:  defect     |      Status:  needs_review
   Priority:  major      |   Milestone:  sage-4.3.2  
  Component:  notebook   |    Keywords:              
     Author:  Dan Drake  |    Upstream:  N/A         
   Reviewer:             |      Merged:              
Work_issues:             |  
-------------------------+--------------------------------------------------

Comment(by mpatel):

 Replying to [comment:6 ddrake]:
 > Replying to [comment:5 mpatel]:
 > Your regexp seems pretty good. I'm a bit confused about
 > {{{
 > %(unquoted)s+(\.%(unquoted)s+)*
 > }}}
 > though. Doesn't that simply match one or more "unquoted" characters? The
 first bit matches one or more, then the second bit matches zero or more --
 so altogether that's one or more. Right? I'm not a regexp wizard by any
 means.

 I'm far from regexpert, myself.  I think the first part, `%(unquoted)s+`,
 matches one or more unquoted characters (e.g., `$uper`), but the rest of
 the line above matches zero or more blocks (e.g., `.duper+foo`), each of
 which begins with a period and ends with a string of at least one unquoted
 character.

 > Also, the RFC (3696) says that the local part has a maximum of 64
 characters and the domain part a max of 255 characters, so maybe we could
 toss in something like this:
 > {{{
 > if re_valid_email.match(email) is None:
 >     return False
 > lengths = map(len, email.split('@'))
 > if lengths[0] > 64 or lengths[1] > 255:
 >     return False
 > return True
 > }}}
 > Thoughts?

 If we later enable quoted local-parts (e.g., `"f...@bar"@barfoo.com`),
 we'll need to modify this test.  But for now, we simply reject them, so
 it's no problem.

 RFC 3696's [http://www.rfc-editor.org/errata_search.php?rfc=3696 erratum
 1003] and [http://tools.ietf.org/html/rfc5321#section-4.5.3.1 RFC 5321]
 also give a ''total'' upper bound of 256 characters (the `sup` may be
 254).  What if we just check that `7 < len(email) < 255`?  I assume we can
 tolerate the [few] false positives that get through --- the confirmation
 message would not arrive at a truly invalid address.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8038#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to