Deleting IMAP mail from shell script

Andrzej Adam Filip anfi at
Thu May 12 19:10:42 EDT 2005

Sun Advocate Webmaster wrote:
> I have a simple question concerning mail deletion in Cyrus mailboxes. I 
> have spamassassin set up, with two mailboxes "spam at" and 
> "notspam at". A shell script runs periodicly and parses these 
> messages (sa-learn compiles training data from the messages). After that 
> parsing is done, it needs to empty the mailboxes.
> I was going to add a "rm" command, but I'm thinking that will cause data 
> corruption with cyrus.
> Is there a better way to do this?

SpamAssassin is wrriten in perl (module named Mail::SpamAssassin).

Have you considered writing you script in perl and using some 
module for accessing *IMAP* mailboxes? [e.g. Net::IMAP::Simple]

Andrzej [en:Andrew] Adam Filip anfi at anfi at
Cyrus Home Page:
Cyrus Wiki/FAQ:
List Archives/Info:

More information about the Info-cyrus mailing list