Set custom retention intervals in Mail

29.05.2009

Once the preferences file is open, click the triangle next to Root to expand the entries (if they're not showing already) then scroll down to the MailAccounts section. Click the triangle there, and you'll see a series of numbers.

The first entry isn't an e-mail account, nor is the last entry (most likely) in the list--the first is an entry for a local mailbox, and the last is an entry for Mail's RSS. But the numbers between those two values each represent one of your e-mail accounts.

Click the triangle next to the 2, for instance, and then look at the AccountName field (or click the triangle next to EmailAddresses) to see which account you've selected. Scroll down until you reach the entries that start with NumberOfDays..., as seen in the image at right. These are relatively self-explanatory; each figure is the number of days that Mail will retain that class of message before deleting. (If a value is -1, that means never delete; if it's 0, that means delete when you quit Mail.)

To specify a custom keep interval, double-click the desired entry (for junk, sent, or trash) in the Value column, and type a new value. Enter your values in days, i.e. 180 is six months. Save the file, quit the editor, and you're done. Mail will now use your custom retention values, though you can easily overwrite them (either accidentally or because you'd like to reset them) by using the pop-up menus on the Mailbox Behaviors tab of the Accounts panel in Mail's preferences.