feat(gmail): make gmail get --format raw text output the exact message, like drafts get --format raw
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Read internal/cmd/gmail_get.go around the raw text output and compare it with internal/cmd/gmail_drafts.go around drafts raw output. Check the workflow guidance in docs/gmail-workflows.md for the documented behavior. Done means gmail get --format raw text produces the exact decoded RFC 822 bytes without a heading or added newline, while IDs remain available through --json.
Written by the indexing model from the issue text.
Description
Summary
gmail get --format raw and gmail drafts get --format raw behave differently in text mode. drafts get writes the exact RFC 822 bytes, so > message.eml works. gmail get adds id, thread_id, and label_ids lines, a blank line, and a trailing newline, so the redirected file is not a valid .eml.
Current (v0.47.1)
gog --account [email protected] gmail get MESSAGE_ID --format raw > message.eml
head -4 message.eml
# id MESSAGE_ID
# thread_id THREAD_ID
# label_ids INBOX,...
#
gmail get:internal/cmd/gmail_get.go#L120-L135prints the three heading lines, thenPrintln(string(decoded)).drafts get:internal/cmd/gmail_drafts.go#L158-L170writes the decoded bytes as is, anddocs/gmail-workflows.md#L313documents "only the decoded RFC822 bytes, without a heading or added newline".docs/gmail-workflows.md#L51notes thatgmail get --format rawtext "includes headings, so use JSON for byte comparisons", so the current behavior is known. Saving a message still takes decodingmessage.rawfrom JSON or usinggmail raw.
Suggested
Make gmail get --format raw text output match drafts get --format raw: the exact bytes, with no heading and no added newline. The IDs stay available in --json. If the heading matters for existing users, an --out <file> flag that writes the exact bytes would also cover saving a message as .eml.
Environment
gog v0.47.1 (also on main at 82e7fd6).
- Dominant language
- Go
- Stars
- 8.5k
- Forks
- 721
- Avg merge
- 20h
- Merged PRs (30d)
- 59
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openclaw/gogcli
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficulty 5/5 Over a week Newbie friendliness 35/100
openclaw/gogcli#1275 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-product-decision clawsweeper:needs-security-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider impact:security issue-rating: 🦞 diamond lobster P2
Difficulty 3/5 1-2 days Newbie friendliness 70/100
openclaw/gogcli#1259 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider impact:crash-loop issue-rating: 🦞 diamond lobster P1
Difficulty 3/5 1-2 days Newbie friendliness 60/100
openclaw/gogcli#1258 · 3 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:needs-live-repro clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr impact:other issue-rating: 🐚 platinum hermit P2
Difficulty 4/5 1-2 days Newbie friendliness 53/100
openclaw/gogcli#1211 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster P2
Difficulty 4/5 3-5 days Newbie friendliness 35/100
openclaw/gogcli#1204 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
automation doc-healer documentation
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
tsukumogami/tsuku#2804 ·
Maintainers usually reply within 1 day
-
Anthropic /v1/messages: only the last thinking block of an assistant message is keptPossibly taken @Shayan12456 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ollama/ollama#19415 · 1 comment ·
Maintainers usually reply within 1 day
-
raised-by:verifier
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
medici-finance/assay#5039 ·
Maintainers usually reply within 1 day
-
metax CheckHealth reads Status.Capacity, so unhealthy Metax-GPU nodes are never cleaned upPossibly taken @barbierajput378-pixel claimed this today. Openkind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Project-HAMi/HAMi#3343 · 1 comment ·
Maintainers usually reply within 1 day