norm-email

Crates.ionorm-email
lib.rsnorm-email
version0.1.0
sourcesrc
created_at2021-10-15 15:13:00.55956
updated_at2021-10-15 15:13:00.55956
descriptionstrip email provider defined behaviour from email addresses
homepagehttps://github.com/orhanbalci
repositoryhttps://github.com/orhanbalci/norm-email.git
max_upload_size
id465531
size15,074
Orhan Balci (orhanbalci)

documentation

README

norm-email 📧

Crates.io Documentation License

Email normalization for your services. This crate is ported from Python library email-normalize written by @gmr.

📦 Cargo.toml

[dependencies]
norm-email = {git = "https://github.com/orhanbalci/norm-email"}

🔧 Example

fn main() {
    let normalizer = Normalizer::new();
    let result = normalizer.normalize("orhan.balci@gmail.com").unwrap();
    println!("{:#?}", result.mx_records);
    println!("{}", result.mailbox_provider.unwrap());
    println!("{}", result.normalized_address);
}

🖨️ Output

[
    MxRecord {
        priority: 30,
        host: "alt3.gmail-smtp-in.l.google.com.",
    },
    MxRecord {
        priority: 20,
        host: "alt2.gmail-smtp-in.l.google.com.",
    },
    MxRecord {
        priority: 5,
        host: "gmail-smtp-in.l.google.com.",
    },
    MxRecord {
        priority: 10,
        host: "alt1.gmail-smtp-in.l.google.com.",
    },
    MxRecord {
        priority: 40,
        host: "alt4.gmail-smtp-in.l.google.com.",
    },
]
GOOGLE
orhanbalci@gmail.com

📝 License

Licensed under MIT License (LICENSE).

🚧 Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

Commit count: 17

cargo fmt