Repository navigation
fix: keep display names intact when parsing recipient lists - #25
Merged
Merged
Conversation
send() split to/cc/bcc strings at every comma, also inside quoted display names, and lower-cased the pieces, so "Ops, Live" <cc@x> reached the provider as "ops, Live" <cc@x> (SMTP, Gmail, Outlook, Yahoo and Mailgun; SendGrid sends bare addresses in this release). Recipients are now parsed with nodemailer's RFC 5322 address parser, which the transports already use; only the address part is lower-cased and the name is kept, quoted only when it needs quotes. Bare address lists normalise exactly as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 18, 2026
## [4.6.2](v4.6.1...v4.6.2) (2026-11-18) ### Bug Fixes * keep display names intact when parsing recipient lists ([#25](#25)) ([0769739](0769739)) ### Fixed * **Recipient names with commas, quotes or angle brackets arrive unchanged.** `"Doe, Jane" <jane@example.com>` in to, cc or bcc used to be split at the comma and partly lower-cased, so the recipient saw the name "doe, Jane" (SMTP, Gmail, Outlook, Yahoo and Mailgun). Addresses are now read with the same RFC 5322 parser the transports use; only the address is lower-cased, never the name. Bare address lists are normalised exactly as before.
Schero94
added a commit
that referenced
this pull request
Nov 18, 2026
The display-name fix shipped in 4.6.2 (#25); this branch's copy of it drops out of the diff. The test keeps this branch's stricter SendGrid check (SendGrid now receives the names). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
send()normalised to/cc/bcc by splitting strings at every comma, also inside quoted display names, and lower-casing the pieces."Ops, Live" <cc@example.com>reached the provider as"ops, Live" <cc@example.com>; a name with angle brackets lost its case. Affects 4.6.1 for SMTP, Gmail, Outlook, Yahoo and Mailgun (SendGrid sends bare addresses in this release, so only the addresses matter there and they were already right).Fix
Recipients are parsed with nodemailer's RFC 5322 address parser (the one the transports already use, no new dependency). Only the address part is lower-cased; the display name is kept byte for byte and quoted only when it needs quotes. Groups and unparseable values are returned trimmed and are validated later as before.
Tests
tests/address-display-names.test.js(37 tests): names with commas, escaped quotes, unicode and angle brackets, mixed lists and arrays, through SendGrid and Mailgun (fake fetch) and at the SMTP, Gmail, Outlook and Yahoo provider boundary. 25 of them fail onmainbefore the fix. One test pins that bare address lists normalise exactly as before.tests/helpers/provider-send-harness.js: fake Strapi with the real router and a recording fetch (test-only).npm test(581: 578 passed, 0 failed, 3 skipped),npm run test:multi-instance(49: 46 passed, 3 skipped)."Ops, Live"and"Ops <Team>"cc names was accepted (200), addresses lower-cased.Found by the live SendGrid suite on #23/#20 (SG-9); the same fix is in #23 and will drop out of it on rebase.
🤖 Generated with Claude Code