README.md in email_inquire-0.9.0 vs README.md in email_inquire-0.10.0

- old
+ new

@@ -21,13 +21,18 @@ While we can't do so much for the name part of the email address, for the domain part, we can be smart! And also, we don't want for users to use one-time email addresses (also called burner or disposable email addresses). -### Supported cases +## Supported cases -Format error. This doesn't strictly follow RFC 5322, it aims at validating email that will be +All supported cases are based on a static validation. +The gem does not check (yet) for domain existence (DNS) and prior delivery (MX entries on DNS). + +### Email format + +This doesn't strictly follow RFC 5322, it aims at validating email that will be deliverable on Internet. It also takes into account length of email, name part and domain part as per SMTP specification. - `foo@domain..com` => invalid - `foo@my..domain.com` => invalid @@ -36,53 +41,80 @@ - `foo@123.123.123.123` => invalid - `secrétariat@domain.com` => invalid - `foo+test@domain.com` => valid - ... +### Typos + One char typo for 43 common email providers (worldwide and from France, United Kingdom and USA): - `gmil.com` => hint `gmail.com` - `hitmail.com` => hint `hotmail.com` - `outloo.com` => hint `outlook.com` - `virinmedia.com` => hint `virginmedia.com` - ... +### ccTLD typos + ccTLD specificity, like United Kingdom `.xx.uk` domains: - `foo.couk` => hint `foo.co.uk` - `fooco.uk` => hint `foo.co.uk` -- `foo.uk` => hint `foo.co.uk` +- `yahoo.uk` => hint `yahoo.co.uk` - `foo.judiciary.uk` => ok! +- `foo.uk` => ok, .uk is open to registration - ... ...and same thing with `.co.jp` & `.com.br` domains. +### Email provider + Providers with an unique domain: - `gmail.fr` => hint `gmail.com` - `gmail.de` => hint `gmail.com` - `google.com` => hint `gmail.com` - `free.com` => hint `free.fr` - `laposte.com` => hint `laposte.net` - `laposte.fr` => hint `laposte.net` - ... -3981 one-time email providers (a.k.a. burners, or disposable email -[source](https://github.com/wesbos/burner-email-providers)): +### Burners +3981 one-time email providers a.k.a. burners, or disposable email +([source](https://github.com/wesbos/burner-email-providers)): + - `yopmail.com` => invalid - ... -Custom invalid domains: Add your own invalid domains: +### Known invalid domains +- `example.com` => invalid + +### Custom invalid domains + +Add your own invalid domains: + ```ruby # in config/initializers/email_inquire.rb EmailInquire.custom_invalid_domains << "bad-domain.com" ``` - `bad-domain.com` => invalid +### Custom valid domains + +Take precedence over all the above rules and make any domain in the list valid, and non hintable. +Add your own valid domains: + +```ruby +# in config/initializers/email_inquire.rb +EmailInquire.custom_valid_domains << "good-domain.com" +``` + +- `good-domain.com` => valid + ## Installation Add this line to your application's Gemfile: ```ruby @@ -199,14 +231,47 @@ Did you mean john.doe@yahoo.com ? ``` Note that you could even have this validation for your Sign In form... +## FAQ + +### Why does a perfectly valid corporate domain is hinted ? + +There are a few cases of corporate domains that will be hinted to the related public provider domain: + +- `google.com` => hint `gmail.com` +- `laposte.fr` => hint `laposte.net` +- `sfr.com` => hint `sfr.fr` + +This is intended. Taking `google.com` (corp) vs. `gmail.com` (public provider): + +- there are far more people with a `gmail.com` address rather than people with `google.com` address; +- employees of Google are well aware of the difference between `google.com` (their employee address) + and `gmail.com` (the public email provider offered by their company) + and will not be mistaken by a hint; +- non-tech savvy people are not, and have in mind "my email address is google", + so not hinting to `gmail.com` would let a lot of actual errors pass. + +If you do not want this, add the affected domains to `EmailInquire.custom_valid_domains`. + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). + + +### Mutation testing + +We use [mutant](https://github.com/mbj/mutant) to ensure that everything is well +tested and the code is minimal. Coverage reported should be close to 100%. + +Run it with: + +``` +bundle exec mutant --include lib --require 'email_inquire.rb' --use rspec -- 'EmailInquire*' +``` ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/maximeg/email_inquire.