moving mail between IMAP folders

Hello all,

I have a Cyrus IMAP server running on HP-UX. I have a requirement to run a script every night at midnight, which will take all the mail (read and unread mail) from one IMAP folder, and move it into a different IMAP folder. Both the source and destination IMAP folders belong to the same IMAP user account.

My various Google exercises have proven fruitless, as they keep turning up scripts for migrating mail from one IMAP server to another server, and completely downloading all the mail content and then uploading it again in the process. That would almost work, however I specifically do *not* want to download and re-upload all the mail content (it's several GB per day of new mail).

All I want to do, is to instruct the IMAP server to move the mail from one folder to another, basically the equivalent of using a GUI mail client to drag-n-drop all the mail from one folder into another folder belonging to the same user.

I can't seem to find a ready solution to this. Any help is much appreciated!!

Try imapfilter.