asadju36 / gmail-cleanup

A script that can clean up trash email in Gmail.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gmail Cleanup

A script to delete all trash emails based on keyword and label filters.

Setup

  1. Install Node.js & npm
  2. Create a Google Cloud Platform project with the API enabled.
  3. Create Authorization credentials for a desktop application and download credentials.json file in the project directory.
  4. Run npm install in the project directory.
  5. Rename keywords.json.sample file to keywords.json and update its contents.
  6. Run node .

Google Cloud Setup

In addition to the steps above, to run this script in Google Cloud automatically at regular intervals, you can do the following:

  1. Create a HTTP triggered Cloud Function.

  2. Copy index.js, package.json, keywords.json, tokens.json, and credentials.json to the Cloud Function.

  3. Create a Cloud Scheduler Job with Authentication.

  4. Add Cloud Functions Invoker role to the Service Account created for Cloud Function.

About

A script that can clean up trash email in Gmail.


Languages

Language:JavaScript 100.0%