I wrote this utility which automatically moves older mail from my main work account to my local archive IMAP server. You might find it useful https://github.com/prenagha/imap-tools P