Simple app to mass deletion or trashing email writen in Go language
- Go
- Credentials for using GmailApi. Follow beginning of this guide
You need Dep to install dependencies
git clone https://github.com/SkYNewZ/gmail-cleaner.git
cd gmail-cleaner
dep ensureYou can now run it by doing go run main.go or build go build -o gmail-cleaner and execute ./gmail-cleaner
go get -u github.com/SkYNewZ/gmail-cleaner$ gmail-cleaner --help
Usage:
main [OPTIONS]
Application Options:
-s, --search= Search criteria
-d, --delete Delete messages ?
--credentials-file= Credentials file path as json for using GmailAPI (default: credentials.json)
Help Options:
-h, --help Show this help messageYou can use multiple
--searchFor example, if yourcredentials.jsonis located into your$HOME, rungmail-cleaner --credentials-file ~/credentials.json ...
# Trash all messages from "github.com"
gmail-cleaner --search "from:(github.com)" --credentials-file ~/credentials.json
# Delete **permanently** messages with subject "[GitHub] A third-party OAuth application has been added to your account"
gmail-cleaner --search "subject:([GitHub] A third-party OAuth application has been added to your account)" --delete --credentials-file ~/Downloads/credentials.json
# Delete **permanently** messages with subject "[GitHub] A third-party OAuth application has been added to your account" and messages from "github.com"
gmail-cleaner --search "from:(github.com)" --search "subject:([GitHub] A third-party OAuth application has been added to your account)" --credentials-file ~/credentials.json --deleteFor more details about the Gmail search engine, checkout docs