| Crates.io | disposable_email_domains |
| lib.rs | disposable_email_domains |
| version | 0.1.0 |
| created_at | 2025-07-02 06:43:38.206006+00 |
| updated_at | 2025-07-02 06:43:38.206006+00 |
| description | A Rust library to detect and block disposable/temporary email addresses during user registration. |
| homepage | |
| repository | https://tempmail100.com |
| max_upload_size | |
| id | 1734628 |
| size | 15,764 |
π‘οΈ 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.
Add this crate to your Cargo.toml:
[dependencies]
disposable-email-domains = "0.1"
Or get the latest from GitHub:
[dependencies]
disposable-email-domains = { git = "https://github.com/houzhongjian/disposable-email-domains" }
use disposable_email_domains::is_disposable;
fn main() {
let email = "user@mailinator.com";
if is_disposable(email) {
println!("Blocked: Disposable email detected.");
} else {
println!("Allowed: Email is not disposable.");
}
}
Blocked: Disposable email detected.
is_disposable(email: &str) -> boolChecks if the provided email address uses a disposable email domain.
email: A full email address like example@mailinator.com
returns: true if it's disposable, false otherwise.
You can also contribute more domains or override the list if needed.
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page or submit a pull request.
cargo run --example update_list
This project is licensed under the MIT License. See the LICENSE file for details.
Made with β€οΈ by Temp Mail