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.
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 useUnfoldingStrategy::RfcCompliant
. To build a Parser using a custom unfolding strategy, use thenew_with_unfolding_strategy
method instead ofnew
. Thenew
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.