This utility was developed for People & Planet's recent migration away from Mercury mailserver to Cyrus IMAP. Given a user name, Pegasus mail directory and password, it creates a new IMAP account, sets a SASL password, and imports the mail folder hierarchy and its contents into Cyrus, as well as trying to set up pegasus to greate a new IMAP prifile (it sometimes works!)
It's not very elegant (particularly in that parts of it use different IMAP perl modules (don't ask) ), and it only recreates your hierarchy one level deep. I found it worked pretty nicely, though. You should note that I assume you are using unix hierarchy seperators in Cyrus. You will also need to download peg_split_and_deliver.pl, and peg_folder_hierarchy.pl for it to work, along with some CPAN modules.