sequoia-rfc2822

Crates.iosequoia-rfc2822
lib.rssequoia-rfc2822
version0.10.0
sourcesrc
created_at2019-04-12 14:11:40.641466
updated_at2019-09-06 16:35:38.953419
descriptionAn RFC 2822 name-addr parser
homepagehttps://sequoia-pgp.org/
repositoryhttps://gitlab.com/sequoia-pgp/sequoia
max_upload_size
id127464
size133,994
Justus Winter (teythoon)

documentation

https://docs.rs/sequoia-rfc2822

README

An RFC 2822 parser.

Currently, this crate only recognizes the RFC 2822 name-addr and addr-spec productions, i.e., things of the form:

Name (Comment) <email@example.org>

and

email@example.org

Although the above appear simple to parse, RFC 2822's whitespace and comment rules are rather complex. This crate implements the whole grammar.

As an extension, in addition to ASCII, we also recognize all UTF-8 code points. NUL, controls, and specials retain their meaning as defined in RFC 2822. Other UTF-8 code points are considered to be text like a.

Further, we also allow dots (.) and at symbols (@) in the atom production. That is, the atom production is extended from:

atom            =       [CFWS] 1*atext [CFWS]

to:

atom               =       [CFWS] 1*atext_or_dot_or_at [CFWS]
atext_or_dot_or_at =       atext | DOT | AT

And, as such:

Professor Pippy P. Poopypants <pippy@jerome-horwitz.k12.oh.us>

is recognized as a name-addr even though RFC 2822 strictly requires that the display-name be quoted like:

"Professor Pippy P. Poopypants" <pippy@jerome-horwitz.k12.oh.us>

Likewise,

foo@bar.com <foo@bar.com>

is recognized as a name-addr even though the @ should be quoted.

This crate does not (yet) implement the new RFC 5322.

Commit count: 5431

cargo fmt