* Go to the menu configuration => Technical => Email => Message Vacuum Rules
* Add the adequates rules for your company. On each rule, you can indicate the models, type and subtypes for which you want to delete the messages, along with a retention time (in days).
* Activate the cron AutoVacuum Mails and Messages
It is recommanded to run it frequently and when the system is not very loaded.