Comments (13)
@karlwilbur Thanks for all of your contributions to this project over the years. I'm no longer developing in Ruby. I've been using Elixir for the past 2 years.
Do you have any interest in taking over the official email_validator
gem?
from email_validator.
@balexand Sure. I'd be happy to.
I'll have to sort out how I am going to support your changes to accommodate David Gilbertson's validation philosophy. While I clearly disagree with that and prefer to have more standards-compliant validation, I respect that there are others who are far less concerned with that than I. As such I don't want to break their implementations and would like to provide them the same support that the community has provided me.
I'm available to work with you to transition this over to me in whichever way you see fit.
from email_validator.
@karlwilbur I suggest maybe providing various levels of validation.
E.g. just allow EmailValidator.method = :strict
(with default to :loose
)
In our case, we do need constantly up-to-date exact validator, so that we stop getting these errors from email provider saying that we're trying to send emails to invalid addresses. Somehow people just love to create emails like "user@gmail" without the ".com" and even thought "gmail" IS a valid domain by domain validator, it's not a valid address and gets rejected. Or addresses like "[email protected]" which turned out to also be invalid.
from email_validator.
also it accepts emojis. I looked at regex. is it really enough?
from email_validator.
The regex does not specify which characters can belong to an email. It just says it needs to be a character. Spaces and emojis fall in these cases :(
from email_validator.
The intent of the "loose" checking is just to confirm that there is an email-like string provided. The README
makes this pretty clear.
I have a fork that maintains the earlier, more strict, validation:
https://github.com/karlwilbur/email_validator
from email_validator.
This is the most beautiful action that the open source community can see
from email_validator.
@kapcod Yep, that's sort of what I have in mind. You can see what I have over at https://github.com/karlwilbur/email_validator and I'll be trying to work those changes into a new release here within the next month or so. I had hoped to get to it sooner, but 2020 just been one of those years.
What I already have does this:
validates :my_email_attribute
validates :my_email_attribute, email: {strict_mode: true}
EmailValidator.valid?('[email protected]')
EmailValidator.valid?('[email protected]', {strict_mode: true})
Or you can enable via your Gemfile
, as explained in the README
, and also via an initializer with:
EmailValidator::default_options[:strict_mode] = true
However, in your case, user@gmail
is technically valid per the RFC, which is how the strict_mode
works. I think that, for you, we might want to add a :require_fqdn
config option similar to what I am with the :domain
option. Do you think that it would work for you if we adding something like this:
# per-model
validates :my_email_attribute, email: {require_fqdn: true}
# via initializer
EmailValidator::default_options[:require_fqdn] = true
I also want to include the ability to supply a custom regexp per-model or via an initializer, but haven't started on that yet.
from email_validator.
from email_validator.
@kapcod, Yes. Correct. This is because "aaa@gmail" is a valid email. Is the same way, "karl@karl-desktop" is a valid email address (I successfully use karl@karl-desktop many times a day). This is per the email standards and are valid emails.
You are looking for something more than just a valid email address. You want to also require a FQDN. Do you think that my suggestion (adding a require_fqdn
option) would work for you?
from email_validator.
@kapcod, I added that require_fqdn
option and enabled it by default. You can check it out here:
https://github.com/karlwilbur/email_validator/commit/a7ec186e29c503231580729066ffa98d7d611d8b
Let me know if you think that would work for your situation.
from email_validator.
@kapcod The require_fqdn
option was added in v2.1.0
. I am closing this issue.
from email_validator.
Just to be clear, the :require_fqdn
option is not enabled by default in the actual release. It can be enabled as detailed in the README
. When :strict
mode is enabled (using mode: :strict
, strict_mode: true
is no longer supported), the :require_fqdn
is also enabled.
from email_validator.
Related Issues (20)
- Is there any way to validate custom domain email? HOT 3
- Security Warning HOT 3
- Alternative gem: email_address HOT 1
- Validation not catching jdoe@example-com HOT 3
- Semicolon and emails with not tld in email addresses in version 2.0.1 HOT 2
- Rails 6 support HOT 5
- Error when putting code in model HOT 1
- Alternative gem: email_verifier
- Badge points to other repo HOT 2
- 2020.example.com is a valid fqdn HOT 8
- Valid numeric domains are considered invalid in strict mode HOT 2
- TravisCI Builds are failing for ppc64le+ruby 2.4 HOT 3
- Add rspec matcher
- Alternative gem: validates_email_format_of
- More disposable domains
- ACE representation of email address with IDN considered invalid HOT 6
- [CodeClimate] Class EmailValidator has 25 methods (exceeds 20 allowed)
- [CodeClimate] Method valid? has a Cognitive Complexity of 6 (exceeds 5 allowed).
- .tech domains
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email_validator.