HOWTO: Borrar mensajes viejos en Cyrus
ipurge -f -d días user/postmaster
# Borrar correos viejos (mas de 30 dias) del postmaster, sin ver reporte:
runuser --c "/usr/lib/cyrus-imapd/ipurge -f -d 30 user/postmaster 1> /dev/null" cyrus
# Borrar correos viejos (mas de 7 dias) del folder Trash del bob@example.org:
runuser --c "/usr/lib/cyrus-imapd/ipurge -f -d 7 user/bob@example.org/Trash" cyrus
# Borrar correos (mas de 30 dias) del INBOX y sub-folders de alice@example.org:
runuser --c "/usr/lib/cyrus-imapd/ipurge -f -d 7 user/alice@example.org" cyrus
Tomado del man:
NAME
ipurge - delete mail from IMAP mailbox or partition based on age or size
SYNOPSIS
ipurge [ -f ] [ -C config-file ] [ -x ] [ -X ] [ -i ] [ -s ]
[ -d days | -b bytes | -k Kbytes | -m Mbytes ]
[ mailbox-pattern... ]
[ mailbox-pattern... ]
DESCRIPTION
Ipurge deletes messages from the mailbox(es) specified by mailbox-pattern that are older or larger than specified by the -d, -b, -k or -m options. If no mailbox-pattern is given, ipurge works on all mailboxes. If the -x option is given, the message age and size MUST match exactly those specified by -d, -b, -k or -m. The are no default values, and at least one of -d, -b, -k or -m MUST be specified.
Ipurge by default only deletes mail below shared folders, which means that mails in mailbox(es) below INBOX.* and user.* stay untouched. Use the option -f to also delete mail in mailbox(es) below these folders.
Ipurge reads its configuration options out of the imapd.conf(5) file unless specified otherwise by -C.
OPTIONS
-f Force deletion of mail in all mailboxes.
-C config-file
-d days
-b bytes
-k Kbytes
-m Mbytes
-x Perform an exact match on age or size (instead of older or larger).
-X Use delivery time instead of Date: header for date matches
-i Invert match logic: -x means not equal, date is for newer, size is for smaller
-s Skip over messages that have the \Flagged flag set.
-C config-file
Read configuration options from config-file.
Age of message in days.
Size of message in bytes.
Size of message in Kbytes (2^10 bytes).
Size of message in Mbytes (2^20 bytes).
-X Use delivery time instead of Date: header for date matches
-i Invert match logic: -x means not equal, date is for newer, size is for smaller
-s Skip over messages that have the \Flagged flag set.
FILES
/etc/imapd.conf
CategorySysAdmin