How to bring E-Mail retention policies to Gmail / Google Mail:
- Go to Google Scripts and create a blank project (make sure you are logged into your Google account);
- paste the code (below) (and modify the policies as needed);
- set a trigger (Resources -> Current Project's Triggers -> Add one now) to run it at the preferred interval; and
- create filters in Gmail/Google Mail that set policies when specific messages arrive
Inspired and adapted from Gmail Automation: 5 Useful Google Scripts to Automate Your Gmail