Google script to automatically archive or trash old emails based on defined search terms. Supports multiple rules, with custom actions for each rule. Uses Gmail search syntax to find matching threads.
To use:
- Go to https://script.google.com
- Go to the Editor and create a .gs file, paste in the contents
- Set up the rules and configuration to suit your requirements
- Give it a test run to ensure it is working OK
- Go to Triggers > Add Trigger. Suggest a daily trigger at any time which suits
- The script will run automatically and keep your gmail box squeaky clean!