Mb2md.pl not only converts mailbox files into a Maildir, but also the /var/spool/mail/$USER mailspool file.
mb2md program is smart enough to not transfer a dummy message such as the one UW IMAPD puts at the start of Mbox mailboxes.
You can add your own search terms to the script to make it ignore other forms of dummy first messages.
Mb2md.pl does not only convert mailbox files into a Maildir but also the /var/spool/mail/$USER mailspool file. It is smart enough to not transfer a dummy message such as the UW IMAPD puts at the start of Mbox mailboxes - and you could add your own search terms into the script to make it ignore other forms of dummy first message.
Here are some key features of "mb2md":
· converting the user's main mailbox that is referenced by the ENV variable $MAIL
· converting a single mailbox into corresponding maildir
· converting multiple mailboxes in a directory into corresponding maildirs
· recursive operation on a given directory to convert the complete mail storage of one user
· replaces all occurrences of dots ('.') in a mailbox name by underscores ('_')
· is able to handle spaces in mailbox names
· is able to handle leading/trailing spaces in mailbox names
· converts mbox files in DOS format (CRLF) to Unix file format
· can strip an extension (e.g. ".mbx") from a mailbox name prior to converting
· uses the Content-Length: header iof told to
· removal of dummy message that a couple of IMAP servers (e.g. UW-IMAPD) put at the beginning of a mailbox
· removal of the "From " line that starts every mail in a mailbox
· removal of the special escape character (>) that the MTA puts in front of lines starting with "From " other than the first line
· setting the file date of a converted message according to the date found in the "From " line of the original mail
· setting the flags F,R,S,T (flagged, replied, seen, deleted) on the filename of the converted message according to the flags found in "Status:"/"X-Status:"/"X-Mozilla-Status:"/"X-Evolution:" headers of the original mail
· should work on all *nix-like OS