https://github.com/marinac-dev/disposable
A library for checking if an email address is from a disposable email service.
https://github.com/marinac-dev/disposable
Last synced: 5 months ago
JSON representation
A library for checking if an email address is from a disposable email service.
- Host: GitHub
- URL: https://github.com/marinac-dev/disposable
- Owner: marinac-dev
- License: mit
- Created: 2024-10-07T00:59:21.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-25T12:45:43.000Z (over 1 year ago)
- Last Synced: 2025-09-19T21:36:29.960Z (9 months ago)
- Language: Elixir
- Size: 929 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Disposable
[](https://hex.pm/packages/disposable)
[](https://hexdocs.pm/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. With over 169.000 domains in the list, Disposable is a reliable tool for preventing users from signing up with temporary email addresses.
## 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`:
```elixir
def deps do
[
{:disposable, "~> 0.1.3"}
]
end
```
## Usage
### Basic usage
```elixir
iex> Disposable.check("user@gmail.com")
false
iex> Disposable.check("user@tempmail.com")
true
```
### Configuration
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`:
```elixir
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:
```elixir
Disposable.reload()
```
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
## License
This project is licensed under the MIT License - see the [LICENSE.md](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.