Here’s how:
Select Mail > Preferences from the Mail menu. Go to the Accounts category. Highlight the account with the Trash folder you want to configure. Go to the Mailboxes Behaviors tab. Under Erase deleted messages, choose the appropriate option (for example, One month/week/day old ). Close the dialog to save your changes.
Mail that is of the specified age will automatically be erased on an ongoing basis.