Email address check function

Robert Vollmert rvollmert at gmx.net
Thu Dec 2 11:31:01 EST 1999


Hello,

> I'm writing some CGI scripts and I want the user to fill in their
> real email address. Checking this is more difficult than just look
> if it contains an '@'. There must be at least one '.' after the '@'
> but there must be non-'@' chars before and after every '.', no white
> space, etc. There must be an RFC for this, but is there a function
> in the standard library that checks if it's OK?

I suppose it would be safest and easiest to lookup up the domain part
of the address. I don't know how to do this in python, but you could
call something like

    host -a domain.com

and check the output.

HTH,
Robert

-- 
Robert Vollmert                                      rvollmert at gmx.net




More information about the Python-list mailing list