├── README.md └── gmailAutoArchive.gs /README.md: -------------------------------------------------------------------------------- 1 | # gmailArchiveScript 2 | 3 | Google script to automatically archive or trash old emails based on defined search terms. 4 | Supports multiple rules, with custom actions for each rule. 5 | Uses Gmail search syntax to find matching threads. 6 | 7 | To use: 8 | 9 | 1. Go to https://script.google.com 10 | 2. Go to the Editor and create a .gs file, paste in the contents 11 | 3. Set up the rules and configuration to suit your requirements 12 | 4. Give it a test run to ensure it is working OK 13 | 5. Go to Triggers > Add Trigger. Suggest a daily trigger at any time which suits 14 | 6. The script will run automatically and keep your gmail box squeaky clean! 15 | -------------------------------------------------------------------------------- /gmailAutoArchive.gs: -------------------------------------------------------------------------------- 1 | function gmailAutoarchive() { 2 | 3 | // gmailAutoArchive - A Google Script to find emails matching search criteria older than x days and trashes and/or archives them 4 | // 5 | // Example search terms: 6 | // 7 | // label: