mail-expire recognizes the following options:
-u If an existing archive file with the expected filename is found, another filename is to be chosen.
This happens by appending a suffix like (NUMBER) to the basename.
This is a legacy option, not compatible with any custom output command.
-tDIR
Specifies a different target directory for storing expired mailbox files. Default is the current
directory.
-TFILEBASE
Explicit output target file name for all inputs (i.e. merging all expired mails into the same target
mbox). This mostly disables automated name generation (base name and date suffix), only the
compression suffix (-c option and related) is appended.
--sfx-fmtFORMAT
Format string, see strftime or date manpage.
--dry-run, -n
Only examine input files and directories, no mail data is moved around.
--delete, -d
Drop the old messages. No backup will be made, be careful with this option.
--keep, -k
Copy the expired messages to output files and keep them in the input file.
--purge=VALUE, -pVALUE
Specify how to remove input files or folders after becoming empty. 0: never remove, 1 (default):
remove empty files but keep folders (also related folders), 2: remove empty Mbox file and Maildir, 3:
like 2 but also remove the input file if it was empty.
-vLEVEL
Verbosity level, where 0 produces no output except for errors, 1 some progress messages, 2 and more
verbose progress messages.
-coutput-shell-command
A shell script fragment which is run in order to archive the data. Default or current value can be
displayed with -v2 option.
This command is very delicate, it might destroy the target file. It might also be suspicious to
shell injection attacks, quotes are important.
-X Shortcut for -c and -s options, compressing with XZ compressor (multiple threads) and .xz file
suffix.
-Z Shortcut for -c and -s options, compressing with Zstandard compressor (zstd or zstdmt where
available) and .zstd file suffix.
-U Shortcut for -c and -s options, to not compress the output and not have an additional suffix.
-l Lockless operation, input Mailboxes are assumed to be not touched by other tools while mail-expire
runs. By default, it attempts to mimic the behavior of procmail to prevent it from file
modifications. This option has no effect on Maildir type input. To be used with care, runtime
conflicts with procmail or other tools MIGHTCAUSEDATALOSS.