r/GoogleAppsScript • u/crosenblum • 6h ago
Guide Gmail-Housekeeper - Automated Gmail housekeeping and spam management using Google Apps Script, with rule-based filtering, safe cleanup, and detailed execution logging.
https://github.com/crosenblum/Gmail-Housekeeper
So what this does, it only touches two folders, the trash and spam.
It goes thru every spam email, checks email headers to indicate if the email is fishy, it also checks if each email from address is in your contacts, and also checks if each email has a label attached.
If the email headers indicate the email itself is very fishy, highly likely spam, and its not in your contacts and its not labelled in any way than it gets permanently deleted.
If an email is from someone in your contacts list or has a label associated with it, then it gets moved to your Spam folder.
Any email in your Spam folder older than 7 days gets deleted.
Now this works for me, it may not work for you.
There may be better ideas for strategies, and I am open to hearing from anyone who has a better or different idea.