Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would think the following would be best practice:

1) use LPeg or something similar to validate the actual text of the email (here's some LPeg that parses the headers of an email, certain one can pull out the email address portion: https://github.com/spc476/LPeg-Parsers/blob/master/email.lua).

2) Take the domain part and do a DNS MX lookup on it (to be pedantic, if that fails, then one should do a DNS A lookup). That will check if the domain is at least valid.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: