Require addresses to pass the built-in EMAIL_REGEXP #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We had an address pass the validation of this gem but was subsequently
treated as invalid when using the mail gem in a very odd way - the
Mail::Message#to method returned a String instead of a
Mail::AddressContainer. This commit uses the built-in
URI::MailTo::EMAIL_REGEXP as part of the default validation.
However, adding this breaks another test - allowing non-ascii characters
in the local part of the address. For us this is OK as we use Amazon SES
at the moment which also does not allow non-ascii characters, but I'm
guessing this may be a problem for others given that the test exists in
the first place.
Perhaps it should be a configuration option? Or feel free to tell us that
we'll need to do that as a separate validation in our app.