[][src]Function mailparse::msgidparse

pub fn msgidparse(ids: &str) -> Result<MessageIdList, MailParseError>

Parse an email header into a structured type holding a list of message ids. This function can be used to parse headers containing message IDs, such as Message-ID, In-Reply-To, and References. This function is currently mostly trivial (splits on whitespace and strips angle-brackets) but may be enhanced in the future to strip comments (which are technically allowed by the RFCs but never really used in practice).

Examples

    use mailparse::{msgidparse, MessageIdList};
    let parsed_ids = msgidparse("<msg_one@foo.com>  <msg_two@bar.com>").unwrap();
    assert_eq!(parsed_ids[0], "msg_one@foo.com");
    assert_eq!(parsed_ids[1], "msg_two@bar.com");