Step 1: Open Thunderbird and click 'Tools' option in the main menu.
Step 2: Click the Account Settings button.
Step 3: Select the account you wish to edit.
Step 4: Click Server Settings in the left side panel.
Step 5: Select what you want to do with messages… option in the list.
Step 6: If you wish to automatically delete them from the server after a cretin time period, click For at most, then pick the number of days you wish to keep them.
Step 7: Click OK to complete the setup.