Validating EMailAdresses for syntactical correctness

Alexander Skwar ASkwar at DigitalProjects.com
Sun Jan 27 02:04:51 CET 2002


So sprach »Michael W. Dietrich« am 2002-01-24 um 10:19:12 -0800 :
> Has anyone ever written a class, function or regular expression, that
> validates EMail-Addresses (e.g. such entered in Web Forms) for their
> syntactical correctness? If so, is that algorithm available? Where?

Forget it.  Although there are some "rules" defined by the RFCs about
how the localpart (before the @) should look like, in reality you'll
find that close to every character can appear there.  I'm just starting
with Python, but in PHP based apps, I resorted to simply checking if
there's a MX (mail exchange) server listed for the domain.  If that
returns true, then all is fine.

Alexander Skwar
-- 
How to quote:	http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:	http://www.iso-top.de      |     Jabber: askwar at charente.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
                       Uptime: 12 days 3 hours 28 minutes




More information about the Python-list mailing list