Properly Validating Email Addresses.

There seems to be a lot of chit chat in the rails world about correctly validating email addresses.  The main problem is the compromise between speed and correctness, observe:

The examples above illustrate the possible methods of email validation ranging from pathetic to extreme.  Given the average response speed of DNS, we think it’s legitimate to attempt a DNS lookup of the addresses domain name.  This ensures that at least the user isn’t just entering ‘asdf@asdf.asdf’ to circumvent validation.  Some applications however will require a higher level of certainty though, and the only way you can do that is to connect to the remote MTA and start message delivery for the address.  Note that you don’t have to complete it, just verify that the SMTP server accepts the RCPT TO command without throwing an error.

We hope you find this somehow useful.