manipulate files in /var/spool/imap/

James Pattie james at
Thu Nov 13 14:17:35 EST 2003

Hash: SHA1

Rajesh Saxena wrote:
| Hi. I would like to create 'spam' and 'notspam' folders in each of my
| users' accounts. The users will be instructed to move spam email which
| spamassassin has missed into the 'spam' folder and move false positives
| into 'notspam'. Then I want to write a script which will traverse
| through all the users folders in /var/spool/imap/users/*/{spam,notspam}
| and move all the emails into temporary directories where I can run
| sa-learn on the missed messages. My question is can I move the text
| files around like that and delete them when I'm done? Except for the
| cyrus.* files -- or should I delete those too? I'm not sure if I need
| to use cyrus provided tools to delete those emails once i don't need
| them anymore or if I can just use rm.

I posted a script that did this to the MailScanner mailing list about 4-6 months

That script will only work for RedHat installs.  If using under Debian, then you
will have to update it.

- --
James A. Pattie
james at

Linux  --  SysAdmin / Programmer
Xperience, Inc.

GPG Key Available at
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.

More information about the Info-cyrus mailing list