feat(gmail): import RFC822 messages - #959
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 10:35 AM ET / 14:35 UTC. ClawSweeper reviewWhat this changesAdds Merge readinessKeep this collaborator-authored feature open: current main has no Gmail import command, and the proposed narrow API wrapper is a coherent solution awaiting product acceptance and the PR’s stated live import/readback validation. Priority: P3 Review scores
Verification
How this fits togetherThe Gmail CLI turns user input into Gmail API requests while applying dry-run, read-only, and command-policy safeguards. This change adds a single-message mailbox write path that reads RFC822 content and returns the imported message metadata. flowchart LR
A[EML file or standard input] --> B[Gmail import command]
B --> C[Parse headers and build plan]
C --> D{Dry run or blocked?}
D -->|yes| E[Safe output or error]
D -->|no| F[Gmail import API]
F --> G[Message and thread IDs]
Decision needed
Why: This creates a durable public command and option set; mechanical tests establish the request shape but do not determine whether this specialized workflow belongs in the supported CLI surface. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the focused one-message command, confirm its public CLI contract, and attach redacted live import/readback evidence from a disposable authorized Gmail account before landing. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new command rather than repairing an existing failing behavior. The included mock-server tests establish the intended request path, while the stated live Gmail check remains to be run. Is this the best way to solve the issue? Yes, conditionally: a one-message wrapper over Gmail's import endpoint directly addresses the linked request without adding IMAP fetching, synchronization, or bulk migration behavior, subject to maintainer acceptance of the new command surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 27af1477df4a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Live proof executed (orchestrator, 2026-08-06, Peter-approved mailbox):
Combined with the in-PR gates (focused tests, |
|
Thank you so much for implementing this, Peter. |
Summary
gog gmail import <file|->for one RFC822/EML messageThis intentionally does not add IMAP fetching, mailbox synchronization, or bulk migration orchestration.
Closes #956.
Proof
go test ./internal/cmd -run 'TestGmailImport' -count=1make ciLive Gmail import/readback remains a pre-merge gate; the execution host currently has no authorized test account.