gemini-cli-extensions / gemini-cli-extensions/workspace

gmail.get silently drops Cc, Bcc and Reply-To headers in metadata/full formats

Open
#388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
638
Forks
107
PR merge metrics
No merged PRs in 30d

Description

Bug

gmail.get extracts only Subject, From, To and Date when format is metadata or full, and silently discards Cc, Bcc and Reply-To. Callers cannot see who a message was copied to without falling back to format: "raw" and decoding the RFC 822 payload themselves.

This is easy to mistake for ground truth: the response simply has no cc field, so a consumer (human or LLM) concludes the email had no CC recipients. In my case this produced a confidently wrong "this email was not CCed to X" determination that only format: "raw" disproved.

Cause

workspace-server/src/services/GmailService.ts (the get handler):

const subject = getHeader('Subject');
const from = getHeader('From');
const to = getHeader('To');
const date = getHeader('Date');

No Cc/Bcc/Reply-To extraction, and the response object only includes the four fields above.

Secondary nit: getHeader matches header names case-sensitively (h.name === name), but header names are case-insensitive per RFC 5322.

Expected

metadata and full responses include cc, bcc and replyTo when those headers are present on the message.

Fix

PR incoming: adds the three headers (omitted from the JSON when absent, preserving current response shape otherwise), makes header matching case-insensitive, and adds tests for present/absent/case-variant headers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in workspace-server/src/services/GmailService.ts at the gmail.get handler and inspect how metadata and full responses extract headers. Add coverage for present, absent, and case-variant Cc, Bcc, and Reply-To headers; done means those fields appear only when present and existing response shape is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.