Restoring mails from a backup imapmbox folder?


Imagine the following scenario: You use Apples Mail 2.0.1. Your mails are stored remotely on an IMAP-Server. In order to access them without internet connection, you configure Apple Mail to store the mails locally as well. There (IMPORTANT!) you decide to store BOTH the message AND the attachment locally. Then you do your backup regularly. Using .Mac Backup you end up with an exact copy of the mail folder which normally resides under ~/Library/Mail. Now you accidently delete one folder on the IMAP server.

Now what do you expect? You think, don't panic, I still have my backup. You're WRONG. There seems to be no way to get your backuped mails back into Apple Mail again. :-(

After hours a searching and thinking I found a way to to convert the proprietary version of Apples EML file back into a mbox file that I could import again. BUT, the files that Apple Mail stores locally are sometimes separated into two or more files. This seems to depend on whether the content of the mail was only ASCII or consisted of normal text and e.g. BASE64-encoded stuff or some other attachments. So I was only able to get those mails back that had no attachments or special encodings. This is, however, unsatisfactory.

So, is there anybody who has any idea to solve this problem? How can I import ALL messages again?