in reply to parsembox

You might be able to reduce this code a bit by using Mail::Folder::Mbox.