I needed to do a similer thing where I wanted to clear a certain mailbox everytime I closed Pocomail down. I ended up looking at the clearmailbox script, printing out the scripts help files and trying to work out what was going on in order to adapt it to my needs.
All the mails I want to keep only for a limited time are filtered into a certain mailbox. I now have a short script in the "Application Closing" part of events that deletes that mailbox everytime Pocomail is closed down.
Then on the "Application Start" tab of events I have another script which deletes that mailboxes .idx file (if I did that when closing down it just seemed to recreate itself and this file seems to cause the headers of deleted files to remain) and then the script recreates the mailbox.
This gives the impression that the mailbox has been emptied! The filters don't seem to get confused but I did need to create the mailbox manually a few times before it all sort of clicked in lol!
I'm no expert with scripts by any means and I'm sure this is really clumsy, but it works for me
Lloyd
