I don't see how this can work in conjunction with Mail::IMAPClient's message_to_file since message_to_file's messages already have message id's which, according to Mail::Box::Mbox, they will then get passed over. And also, I wouldn't be able to pass it a message object like it wants, I would only be able to pass it (at best) a message individually from the IMAP download. This also doesn't seem to have the ability to repair an mbox mailbox which is what seems like it could help.