Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skynewz/gmail-cleaner
Simple app to mass deletion or trashing email writen in Go language
https://github.com/skynewz/gmail-cleaner
gmail gmail-api
Last synced: 13 days ago
JSON representation
Simple app to mass deletion or trashing email writen in Go language
- Host: GitHub
- URL: https://github.com/skynewz/gmail-cleaner
- Owner: SkYNewZ
- License: gpl-3.0
- Created: 2019-01-03T20:42:08.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-04T18:35:23.000Z (about 6 years ago)
- Last Synced: 2024-11-06T07:38:59.160Z (2 months ago)
- Topics: gmail, gmail-api
- Language: Go
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gmail Cleaner command line
Simple app to mass deletion or trashing email writen in Go language
## Requirement
* [Go](https://golang.org/)
* Credentials for using GmailApi. Follow beginning of [this guide](https://developers.google.com/gmail/api/quickstart/go#step_1_turn_on_the)## Install
### Manually
> You need [Dep](https://github.com/golang/dep) to install dependencies
```bash
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
```bash
go get -u github.com/SkYNewZ/gmail-cleaner
```## Usage
```bash
$ 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
```bash
# 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](https://support.google.com/mail/answer/7190)