Skip to content

fix(gmail): match message header names case-insensitively - #946

Closed
rootkiller6788 wants to merge 3 commits into
googleworkspace:mainfrom
rootkiller6788:fix-gmail-header-case-insensitive
Closed

rootkiller6788 wants to merge 3 commits into
googleworkspace:mainfrom
rootkiller6788:fix-gmail-header-case-insensitive

Conversation

@rootkiller6788

Copy link
Copy Markdown

Fixes #642.

parse_message_headers matched on the raw header name, so anything that didn't arrive spelled exactly From/To/Cc/... fell through the match. Exchange/Outlook send CC and MESSAGE-ID, so gmail +reply-all silently dropped the CC list and gmail +read handed back cc: null. If a message also had a non-canonical From or Message-ID, parsing failed outright with "Message is missing From header".

Lowercase the name before matching. get_part_header in the same file already compares case-insensitively, so this just makes the two agree.

I checked the new test fails on the old code ("Message is missing From header") and passes after. Full gmail suite is green, 236 tests.

One note for reviewers: clippy is currently red on this repo for me on 14 pre-existing spots (assert_eq!(x, true) style lints in test code, mostly executor.rs / sheets.rs / main.rs) — none in gmail/mod.rs, and none from this change.

parse_message_headers matched on the raw header name, so a message from
an Exchange/Outlook sender (which emits "CC" and "MESSAGE-ID") had
its Cc header dropped. get_part_header in the same file already does a
case-insensitive lookup, so this was inconsistent too.
Fails on the previous commit with "Message is missing From header".
@changeset-bot

changeset-bot Bot commented Sep 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0a916d8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@googleworkspace/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@googleworkspace-bot googleworkspace-bot added the area: core Core CLI parsing, commands, error handling, utilities label Sep 27, 2026
@rootkiller6788
rootkiller6788 marked this pull request as ready for review September 27, 2026 13:10
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This PR has been inactive for 72 hours. Closing to keep the queue clean.

@github-actions github-actions Bot added the Stale label Oct 1, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 72 hours. Feel free to magically reopen it if you want to continue working on it!

@github-actions github-actions Bot closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Core CLI parsing, commands, error handling, utilities Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(gmail): parse_message_headers uses case-sensitive match, drops CC/headers with non-canonical casing

2 participants