disposable-email-domains
🛡️ A Rust library to detect and block disposable/temporary email addresses during user registration.
disposable-email-domains is a simple and efficient Rust library that helps developers identify whether an email address belongs to a known disposable (temporary) email provider. This is particularly useful in preventing spam registrations or enforcing real-user policies in your application.
✨ Features
- 🚀 Fast email domain lookup
- 🧠 Built-in list of disposable email providers
- 🔄 Supports automatic updates (optional)
- ✅ Simple API and easy integration
📦 Installation
Add this crate to your Cargo.toml:
[]
= "0.1"
Or get the latest from GitHub:
[]
= { = "https://github.com/houzhongjian/disposable-email-domains" }
🔧 Usage
use is_disposable;
Example Output
📚 API
is_disposable(email: &str) -> bool
Checks if the provided email address uses a disposable email domain.
- email: A full email address like
example@mailinator.com - returns:
trueif it's disposable,falseotherwise.
You can also contribute more domains or override the list if needed.
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page or submit a pull request.
To update the domain list:
⚖️ License
This project is licensed under the MIT License. See the LICENSE file for details.
Made with ❤️ by Temp Mail