email syntax validation needed

Alan Grimes alangrimes at
Sun Jun 15 08:22:03 UTC 2003

> Derek Brans wrote:

> 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?

Interesting question! 

It is interesting because Microsoft outlook has such a feature and it
does it WRONG. ;) 

Classicly, when everyone was logged into the campus mainframe which cost
$10,000,000 and had 2MB of memory and you wanted to send a mail to bob
you would simply put "bob" in the "to:" field and the system would
accept it...

Microsoft Outlook will give an error message and absolutly won't let you
send the message.

Wetscrape is somewhat better in that it will simply add the rest of your
e-mail address to the outgoing message, if I set "to:" to Bob in
netscape 4.08 for windows 3.11 it would simply add "" and
send it without complaint...

There are syntactic rules (unfortunately I don't know where to find

Basically what you are looking for is illegal charactors and improper

It should be noted that some sites (such as American Racing as of 1999)
use UUCP e-mail addresses which involve "bang paths" that look something

user!server1!server2!server3 at some.SMTP.server

Testimonial: I wasted 2,000 hours using Linux.

More information about the Squeak-dev mailing list