Repository navigation
fix(gmail): exclude address comments from mailbox extraction - #203
Conversation
jerelvelarde
left a comment
There was a problem hiding this comment.
Reviewed 24c9dff6fde4549fb50cda929307c7967329e9ed.
Prevents comment addresses and encoded display names from being mistaken for mailboxes. The bounded parser change fits the shared mail mapping path. Security: traced raw From parsing, nested/escaped comments, quoted names and To extraction; mailbox selection remains separate from displayed decoded text. No actionable security finding. Verification: 40 Google fixture tests passed. No live Gmail account or actual email send was used.
Local execution used read-only, network-disabled Linux containers with synthetic data and Node 24.17.0. Root dependency fixtures came from main’s manifest rather than the lockfile; exact-head GitHub CI covers locked full checks where green. No production credentials were supplied.
A valid Gmail header such as
Support (old@example.com) <sender@example.com>currently selects the address inside the comment asMail.from; comments inToalso become spurious recipients. Extract addresses from the raw header after removing comments, including nested comments and escaped parentheses, while keeping quoted display names intact.Encoded words remain display text: parse before decoding the sender name so an encoded
(cannot consume the real address, and exclude encoded-word payloads from address matching.Validation: