[UPHPU] MX Records reliable
Lonnie Olson
lists at kittypee.com
Fri Apr 6 08:27:20 MDT 2007
Daniel wrote:
> I have a form where people can submit feedback to the webmaster. I
> want to make sure I can reply to the patron. Would I get most of my
> patrons verified if I check for an MX Record for the email address
> they provide?
Checking DNS records for email validation is generally not a good idea.
It can often be slow. I only recommend it's use in situations where
the email's validation is highly critical. And even then it isn't
always the best way to validate.
Possible email validation steps:
* Regex to validate address conforms to a legal format.
* Use dns_get_record to get any MX and/or A records for a domain
* Connect to their mail host (MX preferred, or A) to ensure connections
are accepted.
* Send a test/bogus message to them to verify user exists, and cancel
send before any actual DATA.
* Send a real test message to them, check for bounce messages.
* Wait for confirmation URL to be clicked.
As you can see these steps have increasing failure rates and complexity.
Many are prone to false positives, and false negatives.
My general recommendation is that only the regex is necessary for most
validation. Simple send a confirmation URL and wait for it to be
registered can be used for very highly critical email validation.
Anything in between is too prone for error, confusion, performance, and
failure.
--lonnie
More information about the UPHPU
mailing list