elixir-mail icon indicating copy to clipboard operation
elixir-mail copied to clipboard

Refactor header parsing to better support RFC 2047

Open andrewtimberlake opened this issue 1 year ago • 0 comments

RFC 2047 specifically states that decoding encoded words before parsing a header may not work

RFC 2047§6.2

NOTE: Decoding and display of encoded-words occurs after a structured field body is parsed into tokens. It is therefore possible to hide 'special' characters in encoded-words which, when displayed, will be indistinguishable from 'special' characters in the surrounding text. For this and other reasons, it is NOT generally possible to translate a message header containing 'encoded-word's to an unencoded form which can be parsed by an RFC 822 mail reader.

I have refactored the parser to decode words after parsing header values. This fixes #180

andrewtimberlake avatar Oct 21 '24 14:10 andrewtimberlake