A ruby implementation of the npm freemail module, which provides a database of free and disposable email domains.
All credit for free.txt and disposable.txt goes to the npm
freemail maintainers.
Add this line to your application's Gemfile:
gem'freemail',require: falseAnd then execute:
$ bundle
require'freemail'Freemail.free?('howard@gmail.com')# trueFreemail.free?('george@mailinater.com')# falseFreemail.disposable?('howard@gmail.com')# falseFreemail.disposable?('george@mailinater.com')# truerequire'freemail'email='example@superlocalfreeemail.com'Freemail.free?(email)# falseFreemail.add_free_domains('superlocalfreeemail.com')# or by ArrayFreemail.add_free_domains(['superlocalfreeemail.com'])Freemail.free?(email)# trueAfter 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, or specify a path option in your gemfile:
gem'freemail',path: '../path/to/your/copy'Bug reports and pull requests are welcome on GitHub at https://github.com/smudge/freemail.
The gem is available as open source under the terms of the MIT License.