[Email-SIG] Email Address Validator
Barry Warsaw
barry at python.org
Wed Oct 20 23:24:31 CEST 2004
On Wed, 2004-10-20 at 05:30, Stuart Bishop wrote:
> I'm not sure I entirely agree. Whilst many odd strings of characters
> might be valid email addresses, I wouldn't want to let them get into my
> systems as if you see them in the real world they are certainly
> erroneous, malicious or test data. When I want an email address, I want
> something much more limited (foo at bar.com), in some cases allowing
> brackets to encode the name in there as well. Its like bang notation -
> plenty of systems will refuse to deal with it now because of its use in
> relaying spam, but it was still technically legal last time I looked.
I actually don't think bang-addresses are legal in RFC 2822.
> It would be possible to validate the domain using DNS, or at least
> confirm the TLD is valid, if the tool is for Internet addresses rather
> than something only meaningful to the local network (foo at mail.intranet,
> bar at localhost).
This is not something our email package parser should do. What our
parser should do is validate the syntax of addresses according to RFC
2822, and probably also be able to split addr-specs into local-parts and
domains (in 2822-speak). Higher level tools can then do stricter
validation of email addresses based on the requirements of the
application.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/email-sig/attachments/20041020/fb5d0afa/attachment.pgp
More information about the Email-SIG
mailing list