validator.js
validator.js copied to clipboard
isEmail returns false when provided email with multiple periods before @
Describe the bug When using isEmail with an email that has 2 or more periods before the @, it returns false.
Examples
The email address "[email protected]" is considered valid by Gmail but isEmail("[email protected]") returns false.
Additional context Validator.js version: 13.7.0 Node.js version: 14.17.5 OS platform: macOS
Tried it in gmail (in registration and as email recipient). It doesn't accept that email string.
@heanzyzabala I have a Gmail is [email protected]. If you send a email to [email protected], this email will send to [email protected] You can read about it: https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
@reserad You can find it in https://github.com/validatorjs/validator.js/blob/c1b21a9c8c5e6bd1597e26354c829ad232251f12/src/lib/isEmail.js#L104-L111
@reserad - can this issue be closed as its invalid to have 2 or more consecutive dots in email address. Check this - https://serverfault.com/questions/395766/are-two-periods-allowed-in-the-local-part-of-an-email-address
Could it be desirable to add an option to this validator that lets you choose if you want to accept gmail's (seemingly) spec-breaking + ending?