As usual, PH has demonstrated a clarity of thinking about issues which
humbles me.
On Fri, 4 Dec 1998, Philip Hazel wrote:
> On Thu, 3 Dec 1998, Jeffrey Goldberg wrote:
>
> > What I need is a quick email address verifier.
> >
> > exim -bt ADDRESS
> >
> > helps determine whether the address is well formed and whether there is
> > a hostname (or MX) for the address, but if the address would generate a
> > 5?? directly from that host, I can't coax out of a one liner.
> What do you propose as the algorithm? You look up the MX record and you
> get back a list of 5 hosts. What do you do next? Try them in order till
> you can connect to one? What if they are all inaccessible?
I obviously hadn't thought it through. I think what I want is
Find the lowest accessible MX. If that does not immediately
reject the address, return success (even if the mail would
eventually bounce).
If there are apparently valid MX hosts but none are acceptible
return something that sigals that specific state of affairs
call it "defer")
Also get a defer from temporary errors.
Basically, what I want here can be reasonably well defined.
(1) In those circumstances where the local MTA, if the mail
were sent, would either immeidately fail or would itself
generate a failure quickly, it should return "fail".
(2) In the situation where the local MTA would queue or otherwise
defer a message to that address it should return a "defer"
(3) In all other circumstances it should return an "OK" even if
the message may fail further down stream.
> I think. The One True Way to check an email address is to send it a
> message.
I agree entirely. I am not trying to replace that, but I need a quick
way to check whether an entered email address is likely to be bad.
Most of the errors I am after will be caught by "exim -bt". I was hoping
for an easy way to catch a few more (though knowing that I wasn't catching
all of them). If there is not quick and easy way to do this, "exim -bt"
will do the job fine.
It is mostly to check in CGIs and the like when people enter an email
address that the thing that they entered is reasonably close to being a
valid email address. This check will be done while collecting the
information from a form. Later "The One True Way" will be used to not
only confirm that the address works, but to confirm that the human at
that address is a willing party to having the address submitted on that
form.
It's just that I am getting tired of people filling out forms who don't
appear to know what their email address is. If I can't check immediately,
I may have no way of getting back to them. Right now I use an ever
nastier regex on the address submitted.
I will use "exim -bt" instead of my regex, since it will check for
well-formedness, and also that the host can at least be resolved.
The more I think about it, the more I realize that I don't really want my
script to wait to test connections.
-j
--
Jeffrey Goldberg +44 (0)1234 750 111 x 2826
Cranfield Computer Centre FAX 751 814
J.Goldberg@??? http://WWW.Cranfield.ac.uk/public/cc/cc047/
Relativism is the triumph of authority over truth, convention over justice.
--
*** Exim information can be found at
http://www.exim.org/ ***