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 41m
- Merged PRs (30d)
- 57
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:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
openclaw/gogcli#1283 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
openclaw/gogcli#1282 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug(calendar): --sort start places all-day events at midnight UTC instead of the calendar's timezonePossibly taken @goutamadwant claimed this today. Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
openclaw/gogcli#1284 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug(calendar): events --page with several calendars sends one calendar's token to all of themPossibly taken @goutamadwant claimed this today. Openclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 3/5 1-2 days Newbie friendliness 25/100
openclaw/gogcli#1281 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Difficulty 3/5 1-2 days Newbie friendliness 72/100
openclaw/gogcli#1280 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
API: `tsc.exe` opens a visible console window on Windows when the parent process has no consoleOpen
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/TypeScript#65083 ·
Maintainers usually reply within 1 day
-
Docker Hub credentials are not used for images written as docker.io/owner/namePossibly taken @Dev-next-gen claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
fix(scan): reject baseline and compliance threshold flags on image scansPossibly taken @WKr1shna claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
authelia/authelia#13659 · 2 comments ·
Maintainers usually reply within 1 day
-
good first issue help wanted testing
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sara-star-quant/Quantum-Go#139 ·
Maintainers usually reply within 1 day