Skip to content

fix(mime-funcs): do not double encode Buffer input when chunking base64 mime words - #1865

Merged
andris9 merged 1 commit into
nodemailer:masterfrom
soroush5:fix/encode-word-buffer-base64
Sep 11, 2026
Merged

andris9 merged 1 commit into
nodemailer:masterfrom
soroush5:fix/encode-word-buffer-base64

Conversation

@soroush5

Copy link
Copy Markdown
Contributor

encodeWord with a Buffer and the B encoding fed base64 of the whole input into the chunking loop, which base64 encodes every part again. The words decoded back to base64 text instead of the original value.

Before: encodeWord(Buffer.from('Hello wörld, ...'), 'B', 30) produced words whose payloads decode to 'SGVsbG8gd8O2' etc. After: they decode back to the input (pinned by a roundtrip test through libmime.decodeWords).

…64 mime words

encodeWord with a Buffer and the B encoding fed base64 of the whole input
into the chunking loop, which base64 encodes every part again. The words
decoded back to base64 text instead of the original value.
@andris9
andris9 merged commit 4327a59 into nodemailer:master Sep 11, 2026
8 checks passed
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