Closed labster closed 7 years ago
The idea is to have a :strict ( or similar ) option that will validate all types of mailboxes. And by default to validate only most common forms. And yes it will have more options to control behavior. Any suggestions are welcome .
I'm feeling like a common use case is that some user sends you an email address on some website, and you want to make sure that they didn't mistype it, so we're probably optimizing for that. Since in that case you probably don't want any strange domains, you'd probably want to leave these two options disabled:
The quoting syntax is weird but it's been around forever. " "@example.com passes Perl 5's Email::Valid, but not this one. So for quoted atoms:
And some other random stuff,
And then maybe a standards-compliance mode, :rfc6531, and theoretically earlier standards modes, but that's less important. These might just set the controls above.
I might have tuits to help eventually. Right now I'm just kind of throwing ideas out - not looking for anything specific done now, just thinking about what might be useful.
On the upside, you're not failing on the email addresses that are breaking Perl 5 code in my dayjob, because
Throw more ideas :) This module is not port.of perl5 Email::Valid and thanks a lot !
First of all, don't feel bad, because Perl 5's Email::Valid also gets this wrong.
Wikipedia has a list of cases which should be valid emails here: https://en.wikipedia.org/wiki/Email_address#Valid_email_addresses A lot of these use the crazier forms of quoting text, but UTF-8 support is also important. The bug is that a lot of these examples are considered invalid by Email::Valid.
RFC 5322 defines the current grammar for email addresses... except that RFC 6531 redefines atext to mean basically any UTF-8 string here: https://tools.ietf.org/html/rfc6531#section-3.3 Which means that almost everything without control characters is now fair game.
It might be useful to have some settings on here like whether or not to allow IP servers or local servers but that's kind of up to you.