Retaining mail

The aox retain mail command inserts or updates a mail retention policy. Users will not be able to delete mail if it matches the policy.

Each policy has a duration, and optionally a mailbox to which it applies and/or a search specification.

If it applies to a mailbox, it also applies to all children of that mailbox. If you specify a search, then the policy applies only to messages that match that search, otherwise it applies to all messages.

The simplest policy is one that matches all messages:

aox retain mail 7

A little more complex is one that matches all messages in certain mailboxes, such as this, which preserves mail forever in the mailboxes /archive/this, /archive/that, etc.

aox retain mail forever /archive

It is also possible to specify a search. This preserves all mail from/to/… for 14 days:

aox retain mail 14 address

The last example has both a mailbox and a search:

aox retain mail 90 /archive/sales address

The syntax used for the search is the same as for aox show search and aox delete mail. (The show search command is a convenient way to experiment with search syntax.)

In case of questions, please write to

Relevant links

About this page

Last modified: 2010-11-19