niax / rust-email

Implementation of MIME Messages for Rust
MIT License
62 stars 34 forks source link

Comply to RFC 5322 #58

Closed Mubelotix closed 4 years ago

Mubelotix commented 4 years ago

According to RFC 5322, "unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP" (https://tools.ietf.org/html/rfc5322#section-2.2.3). However, the rust email crate was removing not only the CRLF but also any following WSP! This behavior may be desired, but is not RFC compliant. That's why I added a configuration enum called UnfoldingStrategy. You can use the UnfoldingStrategy enum to specify the behavior of the parser when unfolding headers. To use the RFC compliant behavior, you can use UnfoldingStrategy::RfcCompliant. To build a Parser using a custom unfolding strategy, use the new_with_unfolding_strategy method instead of new. The new method will build a parser with the same behavior as before (UnfoldingStrategy::Clean), to avoid huge breaking changes.

Some small breaking changes have been introduced.

Mubelotix commented 4 years ago

This crate is not maintained anymore. Closing