Add utf7 decoding for Gmail labels#586
Open
petrmm wants to merge 5 commits into
Open
Conversation
Some IMAP servers emit FETCH responses where an even-indexed atom
(key position) is an integer-shaped token (e.g. "* 1 FETCH (12345 NIL)"
or as observed in the wild on the @integromat/imap consumer side via
extension/quirk responses). convStr returns a JS number for such atoms,
and parseFetch then calls .toLowerCase() on it, throwing:
TypeError: list[i].toLowerCase is not a function
at Parser.parseFetch (lib/Parser.js:431)
Coerce the key token to a string at the extraction site. Value-position
numeric atoms (RFC822.SIZE, MODSEQ, UIDNEXT, etc.) are untouched, so
existing consumers that read those as numbers see no behavior change.
Bump to 0.8.22.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fix TypeError in parseFetch for integer-shaped key tokens
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This solves problem with Gmail labels encoded with modified UTF-7. It is similar to #126