Google Apps Script to automatically delete mails with a certain label after a certain time
Usage
- Think of a deletion scheme and create GMail labels accordingly (e.g. I use labels 'todelete/after1week', 'todelete/after1month' and 'todelete/after3months' here)
- set up filters in GMail to flag desired mails with these labels
- create a Google Apps Script with this script (adapt function names, labels and day offsets appropriatedly) and set up triggers as desired