IMAP
http://blog.cihar.com/archives/2007/05/17/imap_utils_0_1/
Cyrus
http://blog.waja.info/2008/09/19/migrating-mails-from-dovecot-to-cyrus-what-a-pain/