Skip to content

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

Description

@mickey-mikey

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions