disposable_email_domains

Crates.iodisposable_email_domains
lib.rsdisposable_email_domains
version0.1.0
created_at2025-07-02 06:43:38.206006+00
updated_at2025-07-02 06:43:38.206006+00
descriptionA Rust library to detect and block disposable/temporary email addresses during user registration.
homepage
repositoryhttps://tempmail100.com
max_upload_size
id1734628
size15,764
δΎ―εΏ ε»Ί (houzhongjian)

documentation

README

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:

[dependencies]
disposable-email-domains = "0.1"

Or get the latest from GitHub:

[dependencies]
disposable-email-domains = { git = "https://github.com/houzhongjian/disposable-email-domains" }

πŸ”§ Usage

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.");
    }
}

Example Output

Blocked: Disposable email detected.

πŸ“š 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: true if it's disposable, false otherwise.

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:

cargo run --example update_list

βš–οΈ License

This project is licensed under the MIT License. See the LICENSE file for details.


Made with ❀️ by Temp Mail

Commit count: 0

cargo fmt