Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DELTA : A script to delete Emails

Motivation

My gmail was filled with OTP mails (mainly from erp iitkgp) and it was kinda annoying

How to use this

  1. First clone the repo
  2. Create a .env file and set it up using .env.template (this is the most important part)
  • TARGET_MAIL= Your full Gmail address.
  • TARGET_MAIL_APP_PASSWORD= This is a 16-character password. To get this, turn on 2-Step Verification in your Google Account settings, then go to App Passwords to generate one.
  • TARGET_SUBJECT= The text to search for, e.g., "OTP for Sign In in ERP Portal of IIT Kharagpur". (It matches any email with subject containing this text).
  • TARGET_DAYS= Set this to n to delete emails from the last n days only (n = any integer)
  1. Run the script
go run main.go

Note

  1. For the script to instantly remove emails from your Inbox, you must ensure Gmail's "Auto-Expunge" is enabled.
  • Open Gmail in your browser.
  • Go to Gmail Settings > Forwarding and POP/IMAP.
  • Under IMAP Access, find Auto-Expunge.
  • Make sure it is set to "Auto-Expunge on - Immediately update the server".
  1. This script acts safely: It moves matching emails to the Trash folder; it does not permanently delete them immediately. If you accidentally delete something important, you can restore it from the Trash within 30 days (before Gmail permanently removes it).

About

A Go script to delete your emails based on their subjects :)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages