Simple Pest based parser for E-Mail headers like From, To, Cc, Bcc, etc.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eaon 23d43a099f
Somehow I overlooked a couple missing characters for a long time
3 years ago
grammars Allow more weirdly placed whitespaces 3 years ago
src Error::description and Error::cause are deprecated 3 years ago
Cargo.toml Adding a hand-wrung best effort 4 years ago
LICENSE Renaming bits to make more sense and adding GPL-3 5 years ago Somehow I overlooked a couple missing characters for a long time 3 years ago
appveyor.yml Refactoring to be more "correct" in terms of output and parsing 5 years ago


Build status Crate version Documentation License

Relatively naïve Pest based parser, picking out "contacts" from "email address lists" found in headers such as from, to, cc, etc.

This library aims to be practical rather than "correct". It is (potentially excessively) permissive in parsing even the worst garbage in everyone's inbox. Limited testing with real world data was done, but the grammar probably still needs work to catch even more edge cases.

0.0.x releases may contain bugfixes and features, 0.x.0 might break compatibility.


RFC compliant header:

use email_address_list::*;

let manual: AddressList = vec![
    Contact::new("rí").set_name("Túsainm Sloinne"),

let result = parse_address_list(
    "Túsainm Sloinne <rí>,"


Non RFC compliant header:

let manual: AddressList = vec![
    Contact::new("").set_name("Ime Priimek"),
        .set_name("Oblikovan, Nepravilno"),

let result = parse_address_list(
        r#""Ime Priimek" <;>, "#,
        "Oblikovan, Nepravilno <,>>, ",


If you find examples of email-address-list failing, either by omitting addresses or supplying wrong addresses, please share them with the author.

For further information, please see the documentation.