I think with minor modifications this should also very helpfully for deleting "old" trash messages
I find very often trashes with over 75% quota of user sapce
especially users which access email only by mobile phone (they delete the message but it will not care about trash)
it will be another "dirty" way to keep clean your server
for the moment I use xpunge plugin on thunderbird clients with some settings on several (trash, junkmail, ...) folders as:
- delete mesages older than xx days,
but this mean
1. user use thunderbird (mobile users - not so often)
2. you need access to user account on his computer (not so easy in some cases)
3. users be quite "kind" to don't override your settings in their account