[BUG] Re: email syntax validation needed

Lex Spoon lex at cc.gatech.edu
Sun Jun 15 11:21:37 UTC 2003


merlyn at stonehenge.com (Randal L. Schwartz) wrote:
> >>>>> "Derek" == Derek Brans <brans at nerdonawire.com> writes:
> 
> Derek> Does anyone have code (or is there any in the image) which, given a string, returns whether or not that string is a syntactically valid email address?
> 
> In addition to the other messages in this thread, let me also point out
> that the following are valid:
> 
>   *@qz.to (my friend, Eli the bearded uses this one)
>   fred&barney at stonehenge.com (my example when it comes up - go ahead and test it!)
>   merlyn@(that's "at")stonehenge(the rock place (that rocks!)).com(dot com!)
> 

For the record, Squeak's mail parser handles the first and third, but
loops on the second.  There is an issue with the various character sets:
$& is not in the list of valid atom characters, and there is no check in
the parser for characters that don't match any valid character set.

In the third case it removes the comments for you.


> In general, there are no illegal characters, but everything has to appear
> in a proper context.

Are you certain that & may be used in an atom?  I followed the RFC
religiously, and I'm sure I started at <atom> and worked out the list of
allowed characters.  But maybe I misread it, or maybe a later RFC allows
more characters?


Lex



More information about the Squeak-dev mailing list