Skip to content

Simple app to mass deletion or trashing email writen in Go language

License

Notifications You must be signed in to change notification settings

SkYNewZ/gmail-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail Cleaner command line

Simple app to mass deletion or trashing email writen in Go language

Requirement

  • Go
  • Credentials for using GmailApi. Follow beginning of this guide

Install

Manually

You need Dep to install dependencies

git clone https://github.com/SkYNewZ/gmail-cleaner.git
cd gmail-cleaner
dep ensure

You can now run it by doing go run main.go or build go build -o gmail-cleaner and execute ./gmail-cleaner

Automatically

go get -u github.com/SkYNewZ/gmail-cleaner

Usage

$ 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 message

You can use multiple --search For example, if your credentials.json is located into your $HOME, run gmail-cleaner --credentials-file ~/credentials.json ...

Example

# 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 --delete

For more details about the Gmail search engine, checkout docs

About

Simple app to mass deletion or trashing email writen in Go language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages