Skip to content

Instantly share code, notes, and snippets.

View jpotisch's full-sized avatar

Joel Potischman jpotisch

  • Brooklyn, NY
View GitHub Profile

Keybase proof

I hereby claim:

  • I am jpotisch on github.
  • I am jpotisch (https://keybase.io/jpotisch) on keybase.
  • I have a public key ASD1tfsPWjXpNjqx5UPxzfB2rFLWq5e1LVjK_pgTpsKPqwo

To claim this, I am signing this object:

@jpotisch
jpotisch / mailCleanup.gs
Last active January 23, 2020 16:08
Google App Script (https://script.google.com/home) to automatically archive or delete emails. I use it to manage email from lists that I don't want to unsubscribe from but I want to prevent from building up forever in my inbox. Add a trigger to have it run every day. It emails me a summary of its actions, and it deletes old copies of that email!
var totalCount = 0;
// Entry point must be named doGet for HTTP GET and doPost for HTTP POST
function doGet() {
return mailCleanup()
}
// Define mail filters, perform actions (archive or delete) on each one, send email report when done
function mailCleanup() {
var blastSenders = ['from:foo@bar.com',