MAIL-EXPIRE(1) | User Commands | MAIL-EXPIRE(1) |
mail-expire - program to extract outdated messages from mbox files
mail-expire is a small utility which only purpose is to help on keeping the size of multiple mail folders as small as needed (by removing outdated messages).
Maildir and Mailbox formats are supported for input, both types are mentioned interchangeably in this manual page. Output goes to Mailbox files.
The old messages are compressed with gzip or xz and stored in the file with the name following the pattern MBOXNAME.MONTH_YEAR.gz (or similar). The reference time for the output filename is calculated from the current time minus number of days specified in the first parameter.
If a file of the same name is found, the default storage strategy is appending a new compressed region to the existing file (unless -u option is used). This allows, for example, to run the expiration in a cron job each weekend, while collecting all mails from (roughly) each month into dedicated buckets. The drawback of this appending mode is a slightly reduced compression ratio, the advantage is reduced disk usage all the time. Also, such archives can later be recompressed separately to achive the highst compression ratio (like: "mv x.xz x.old.xz && xzcat x.old.xz | xz -9 > x.xz && rm xz.old.xz").
For Mbox input, additional disk space to store the amount of fresh messages plus a portion of the size of expired messages (depending on the output compression).
For Maildir input, only additional space for a portion of the size of expired messages (depending on the output compression) is required.
mail-expire recognizes the following options:
This is a legacy option, not compatible with any custom output command.
This command is very delicate, it might destroy the target file. It might also be suspicious to shell injection attacks, quotes are important.
This manual page was written by Eduard Bloch. Permission is granted to use, copy, distribute and/or modify this document under the terms of the MIT license.
2021-01-01 | mail-expire 0.9.1 |