Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor header parsing to better support RFC 2047 #181

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

andrewtimberlake
Copy link
Collaborator

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

Copy link

@kant01ne kant01ne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good to me! Thanks for that!

@andrewtimberlake andrewtimberlake merged commit f8a1565 into DockYard:master Nov 6, 2024
12 checks passed
@andrewtimberlake
Copy link
Collaborator Author

Thanks @kant01ne

@andrewtimberlake andrewtimberlake deleted the rfc2047 branch November 6, 2024 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants