Automatically expire messages in imap folder

Dwight Tovey dwight at
Thu Jun 3 11:13:14 EDT 2004

Adi Linden said:
> Is it possible to have cyrus-imap automatically expire messages in a
> subfolder for every user of the system? I would like to deliver messages
> identified as SPAM to a particular folder, INBOX.spam. Further it would be
> nice if the number of messages in this folder could be limited, not by a
> quota but by automatically deleting older messages. Is that possible?

You can use 'ipurge' in a cron script.  I have my users put their spam in
a "Spam" folder then have a nightly cron job run 'sa-learn' on it followed
 su cyrus -c '/usr/lib/cyrus-imapd/ipurge -f -d 10 user/dwight/Spam'

This deletes anything over 10 days old.

Dwight N. Tovey
email: dwight at
To steal ideas from one person is plagiarism; to steal from many is research.

Cyrus Home Page:
Cyrus Wiki/FAQ:
List Archives/Info:

More information about the Info-cyrus mailing list