[Zope] Email address validator?
Bruce Eckel
Bruce@EckelObjects.com
Sun, 25 Nov 2001 09:03:11 -0800
Here's an update:
"All SMTPSenderRefused is telling you is that Sendmail didn't like
the
sender's address, meaning it wasn't conformant to the relevant RFCs
to
be an Internet e-mail address. If you're just checking the
formatting,
it's about as good as you'll find anywhere. If you're looking for
a valid
delivery location, the only true test is to send it and not receive
a
bounce, which really only means that the other machine didn't tell
you
it was not valid."
On Sun, Nov 25, 2001 at 08:52:13AM -0800, Bruce Eckel wrote:
> Yes, the invalid sender was actually the problem, since that is
the
> address that the registrant has filled out in the form. I'm
trying
> to figure out now whether this test is reliable enough that I can
> ignore the other checks of the email address, or if I should do
> those on top of this.
So it appears from this that one could skip our format-checking
code, and just catch SMTPSenderRefused as a test for the validity
of the email address formatting. The value of this is that if the
RFCs change, someone else would update the format-checking code (in
sendmail).
*********** REPLY SEPARATOR ***********
On 11/25/01 at 8:28 AM Jim Washington wrote:
>Bruce Eckel wrote:
>
>>Thanks! I spent a bit of time refactoring it. Also, I decided
that if it
>worked it would return the address, otherwise it would return None
to
>indicate failure.
>>
>[refactored code snipped]
>
>Interesting style! Thanks! Always good to learn a new thing or
two.
> Do you plan to work on the other part about querying the SMTP
server
>about whether it accepts mail for [email_address]?
>
>-- Jim Washington
Most current information can be found at:
http://www.mindview.net/Etc/notes.html
===================
Bruce Eckel http://www.BruceEckel.com
Contains free electronic books: "Thinking in Java 2e" & "Thinking
in C++ 2e"
Please subscribe to my free newsletter -- just send any email to:
join-eckel-oo-programming@earth.lyris.net
My schedule can be found at:
http://www.mindview.net/Calendar
===================