4 ms·
I possess a very short domain on a widely used older TLD, and even that causes some interesting validation bugs like ‘email domain cannot be less than 6 charact
by PebblesHD 4y ago
I possess a very short domain on a widely used older TLD, and even that causes some interesting validation bugs like ‘email domain cannot be less than 6 characters’ for example…
If only there were some widely documented standard for validating an email address instead of a perl regex passed around campfires since 1979.
- citrin_ru 4y agoThere is relatively easy way to validate domain part - resolve and check that there is either an A or an MX record (but if you do resolve be prepared to wait - I've seen domains DNS query to which takes many seconds of even minutes because of poor internet links or infrastructure). And the local part just not worth validating. May be reject non-ascii if your system doesn't support SMTPUTF8. Full RFC syntax is very complex for historic reasons and most simple regexps developers tend to use reject addresses people do use. I try to use a email like me+www.service-name.com@example.com when possible but many services reject such perfectly valid address.