News for hackers. Stuff that matters.
Re:Show HN: Gmail CLI Utils (bulk delete mail by query, get/... by tleb_ on Thursday April 30, 2020 @06:14AM (#23029294)
Related: I recently used mbsync and notmuch to clean-up my Outlook/Live/Office email account. A one-liner to get email count per domain:

    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.

There are no comments on this comment yet.