1 unstable release
0.1.0 | Oct 15, 2021 |
---|
#1679 in Text processing
16KB
321 lines
norm-email 📧
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.
Dependencies
~9MB
~169K SLoC