-
Notifications
You must be signed in to change notification settings - Fork 497
Description
Problem
When deleting large volumes of emails from a sender, the current workflow requires:
gog gmail msgs list "from:x" --allto collect IDs- A loop of
gog gmail trash <id>calls — one per message
With 400+ emails, this triggers Gmail API rate limits (403 rateLimitExceeded), requiring throttling to ~1 req/sec and taking 7+ minutes.
Workaround Discovered
gog gmail batch modify --add TRASH --remove INBOX <ids...> works and handles hundreds of IDs in a single API call. But it requires a two-step list-then-batch pipeline.
Feature Request
Add a trash-all (or trash --query) command that combines search + batch modify in one step:
gog gmail trash-all "from:thrivemarket.com" --account user@gmail.com
# or
gog gmail trash --query "from:thrivemarket.com" --all --account user@gmail.comThis would internally:
- Paginate through all matching message IDs
- Batch-modify them (add TRASH, remove INBOX) in chunks of 100–1000
Why not batch delete?
gog gmail batch delete requires the https://mail.google.com/ scope which many users won't have granted. Batch modify with the TRASH label works with the standard gmail.modify scope.
Impact
Makes bulk inbox cleanup (unsubscribe + delete workflows) fast and ergonomic instead of requiring scripted workarounds.