View Source Disposable
Disposable is an Elixir library for checking if an email address is from a disposable email service. It provides a fast, memory-efficient way to validate email domains against a known list of disposable email providers.
Features
- Fast in-memory checking of email domains
- Easy to use API
- Configurable disposable domains list
- Ability to reload domains without application restart
Installation
The package can be installed by adding disposable to your list of dependencies in mix.exs:
def deps do
[
{:disposable, "~> 0.1.0"}
]
endUsage
Basic usage
iex> Disposable.check("user@gmail.com")
false
iex> Disposable.check("user@tempmail.com")
trueConfiguration
By default, Disposable uses a built-in list of disposable email domains. You can provide your own list by setting the :disposable_domains_file configuration in your config.exs:
config :disposable, disposable_domains_file: "/path/to/your/domains.txt"Reloading domains
If you update your domains list, you can reload it without restarting your application:
Disposable.reload()Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgments
- Thanks to all contributors who have helped with this project.
- Special thanks to the maintainers of various disposable email domain lists that helped in creating our initial list.