Show HN: Gmail CLI Utils (bulk delete mail by query, get/create filters)
github.com
github.com
That finds everything bigger than 5 megabytes. You can't sort by size, but at least you can find big stuff. If that search has too many results, just keep upping the number until you find the few really big messages.
your suggestion on "auto analysis for cleanup" is good, I'll add it to my ToDo list
For "Declarative configuration for Gmail filters", see also https://github.com/mbrt/gmailctl
* How many emails I get from a sender
* From mails' subject
* Which similar mails I open or not.Can anyone recommend a Mac/web Gmail UI with exceptionally fast hotkey interactions? The Gmail web interface has slowed to the point of un-usability for me now.
Command line (Alpine, etc) would be fine, but my Gmail account is secured by work and has the required access control settings disabled.
30 USD/month was a bit more than I can justify so I cancelled but I still wish I hadn't.
Not sure what you meant by 'secured by work' - you can still authorize 3rd party apps can't you? Is it even possible to block that?
Secured by work was a reference to one possible suggestion of using Alpine or similar, which requires app-specific passwords. And yes, it seems it is possible to block that!
Have you tried deleting a very large number of messages? I am talking about > 100,000. I once needed to clean up > million messages and it was rather challenging even utilizing Google's scripting. Batching ( within Google's recommended parameters ) would periodically fail. Triggers would not run. etc.
I took several days deleting a few hundred thousand messages, "Select all", "delete". Each time it would remove 1000-10,000 messages and leave the rest. Was a real pain.
1. Get current time, increase the time by 5 minutes and find the 5 minute mark after that.
2. Register itself to run the time determined in (1).
3. Fetch a batch of 9000 ids matching the filter.
4. Delete the batch
This script would comfortably run for days cleaning out the inbox until it would hit some weird message that looked nearly identical to the messages around it and bomb(!?). Running it by hand would bomb at which point script won't be able to continue to execute. Deleting a message by hand would work. Running the script again after the manual deletion would work.
although I tried deleting for one or two years at a time
1. Move all the messages to a folder.
2. Then delete that folder.
notmuch address '*' | sed "s/^.*@//" | sed "s/>\$//" | sort | uniq > domains.txt
To "delete" emails (move them to the deleted folder): notmuch search --output=files --format=text0 '(tag:whatever and not folder:Deleted' | xargs -0 --no-run-if-empty mv -t ~/.mail/live/Deleted/new/
Useful alternative to this for non-Gmail. The Outlook interface couldn't delete more than a few hundred mails.https://github.com/skx/labeller/
Adding/Removing labels based upon arbitrary expressions/headers/values, etc.
Just mark everything as read. If it's important, they'll send it again. I cheat by marking everything more than 30 days old as read.
I do that once a year in February. I mark everything from the previous year as read on Feb 1. Sometimes I do it again in July/August.
I sit at zero most of the time, and ive only ever missed emails a bare handful of times, so seems to work.
https://github.com/MichaelYock/GmailScripts/blob/master/Gmai...
Come to think of it, i was going to make a GUI for this now that gmail add-on Cards have a Home Card option
But this is cool and love to know if there is a "add one" feature i missed.
available here: https://developers.google.com/gmail/api/v1/reference/users/s...
I'm cheap. :-)