feat(mail): add batch subcommand, docs, and CHANGELOG (0.2.6) - #18
Merged
Conversation
Carries forward the unique portion of #13. The env-var and mail-list work in that PR landed independently via #14 and #16, so only the batch command remains; this drops the duplicated implementations rather than conflicting with what shipped. mail batch runs multiple label/unlabel/archive/move/flag/delete operations over a single IMAP session, avoiding a connect and auth round-trip per operation. All operations are validated up front, so malformed input fails before any connection is opened or any mailbox is mutated. Names containing IMAP special characters or CRLF are rejected, and input is capped at 10MB. Also fixes two defects from #13: - The --help-json examples used \" inside raw string literals, which emitted literal backslashes into the agent-facing schema. - docs/commands.md listed `seq` as a --fields name; the implementation that shipped in #16 uses `seq_num`. Adds a CHANGELOG covering everything in 0.2.6 and bumps the version. Closes #10. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #13, carrying forward only its unique portion.
#13 bundled three features. Two of them — the
PM_CLI_BRIDGE_PASSWORDenv var (#8) and themail listserver-side filtering / envelope fields / field selection (#9) — landed independently via #14 and #16, which conflicted with #13 across five files. Rather than resolve duplicate implementations of shipped features, this PR keeps only the batch command, which nothing else covers.mail batch(closes #10)Runs multiple
label/unlabel/archive/move/flag/deleteoperations over a single IMAP session, avoiding a connect + auth round-trip per operation. Reads a JSON array from stdin or--file.Validation happens up front, before any connection is opened — malformed input can't leave a mailbox half-mutated. Verified end-to-end:
CRLF/wildcard injection into mailbox and label names is rejected, input is capped at 10MB, and errors pass through
safetext.SanitizeForTerminal.Two defects fixed from #13
--help-jsonescaping. The batch examples used\"inside backtick raw string literals, so literal backslashes leaked into the agent-facing schema. Now emits valid JSON.docs/commands.mdfield name. Listedseqas a--fieldsvalue; the implementation that actually shipped in feat(mail list): server-side unread/flagged filtering, envelope fields, and field selection #16 usesseq_num.Also included
docs/batch-format.md(operation schema) anddocs/commands.mdupdates — the latter also documents the env var and new list flags from feat(config): read Bridge password from PM_CLI_BRIDGE_PASSWORD env var #14/feat(mail list): server-side unread/flagged filtering, envelope fields, and field selection #16, which weren't otherwise covered there.CHANGELOG.mdfor the full 0.2.6 set, crediting @Juan-de-Costa-Rica for reporting feat: read bridge password from environment variable #8–bug: silent success when STORE/COPY targets UIDs not present in selected mailbox #11 and @kochj23 for feat(config): read Bridge password from PM_CLI_BRIDGE_PASSWORD env var #14/fix(imap): error instead of silent success when STORE/COPY/MOVE target UIDs aren't present #15/feat(mail list): server-side unread/flagged filtering, envelope fields, and field selection #16.Verification
gofmt -l,go vet ./...,go test ./...clean.--help-jsonsmoke-tested for correct rendering and version.🤖 Generated with Claude Code