feat: batch mail operations (multiple UIDs per command)#10
Merged
Conversation
mail delete/move/star/unstar/mark-read/mark-unread now accept multiple UIDs in one invocation, acting in a single IMAP session instead of one connection per message. mail move takes the destination via --to so the UID list can be variadic. - imap: add DeleteMessages/MoveMessages/SetFlagsMulti (+ Star/Unstar/ MarkRead/MarkUnread multi wrappers) operating on a UID set; the single-message methods now delegate to them. - cmd: variadic UID args; move gains a required --to flag. - README: document the batch syntax. Enables bulk inbox organization (clearing junk folders, filing by category) that was impractical one message per process. Co-Authored-By: Claude Opus 4.8 (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.
Summary
mail delete/move/star/unstar/mark-read/mark-unreadnow accept multiple UIDs in one invocation, acting within a single IMAP session instead of one process/connection per message.mail movetakes the destination via--toso the UID list can be variadic.DeleteMessages/MoveMessages/SetFlagsMulti(+StarMessages/UnstarMessages/MarkReadMulti/MarkUnreadMulti) operate on a UID set; single-message methods delegate to them.movegains a required--toflag.Why
Enables bulk mailbox organization (emptying junk folders, filing by category) that was impractical when each message needed its own process.
Verification
gofmt/go vet/go buildclean;go test ./...green.yoy mail star 17296 17297flagged both;unstar 17296 17297reverted both (verified via--json).🤖 Generated with Claude Code