4 ms·
That's how I do it. Check for an @. Anything past that is sendmail's problem.
by x0 10y ago
That's how I do it. Check for an @. Anything past that is sendmail's problem.
- nkozyra 10y agoEven though it false positives some valid emails, I've always felt requiring a @ and a . is a good check for public facing validation.
- Piskvorrr 10y agoTechnically valid e-mail addresses - but nonsensical ones. I haven't seen an e-mail without a domain cross a network in decades ("cross a network" excepts "user@localhost", and I'm not old enough to have seen any IP-adressed mails ;)). So yes, I believe that in 2016, a match on ^[^@]+@([^.@]+\.)+[^.@]+\.?$ does not have any actual false negatives, although allowing false positives. That's not entirely helpful in this CVE, though.