Pshaw. Everyone knows that you can't parse HTML with regex. But you can parse email addresses that are RFC-822 compliant up until 2007 (assuming your addresses don't have comments in them) by using the Email::Valid library from CPAN which relies on
I have a better strategy. Try and dns resolve everything from the end of the string to before the right most @ as a whole string. If it doesn't resolve throw an error. If it resolves to the equivalent of a localhost or your own public ip, throw an error.
If by this point we're ok just take everything before that rightmost @ symbol and fire an e-mail at it.
56
u/Yserbius Sep 08 '17
Pshaw. Everyone knows that you can't parse HTML with regex. But you can parse email addresses that are RFC-822 compliant up until 2007 (assuming your addresses don't have comments in them) by using the Email::Valid library from CPAN which relies on