email address verification

Darren New dnew at san.rr.com
Thu Mar 22 11:25:40 EST 2001


> does python provide quick/simple way to verify that an email address exist?

It depends on what you mean by "exist" to a great extent.

> i looked at the smtp library and the verify method but that does not seem
> to be very standard anymore. 

It is standard, except spammers have caused most ISPs to turn off this
useful functionality, yes.  (Pendatically yours...)

> is there anything else that is simalar?

The best way to do this is to take the email address (fred at example.com) and
look up the MX records for the domain (example.com), or the A record if no
MX records. Find the MX record with the lowest priority number. Open an SMTP
connection to that host. Do a MAIL FROM:<> and then a RCPT
TO:<fred at example.com> then a RSET and a QUIT. If the RCPT TO and everything
before it succeeds, you have an "existing" email address. It might not be
the address that gets delivered to fred, but the mail will get delivered.
I.e., it might generate a bounce return, but there's no way to distinguish
between "I delivered it successfully to a program from which Fred will fetch
it" and "I delivered it successfully to a program which will automatically
generate a message saying Fred doesn't live here."

Hope this helps.

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST).  Cryptokeys on demand.
A million monkeys in a room with a million typewriters 
              will only yield half a million pregnant monkeys.



More information about the Python-list mailing list