Folder Conversion between Mozilla and UW Mailbox Standards

Recently I had the need to move my Email out of Mozilla folders into the standard Unix Email format. To my surprise pine and imapd by the University of Washington (UW) were not able to cope with Mozilla's folders and only displayed some of the emails in these folders. Sometimes the whole folder was considered to be a single email with an attachment of all the emails.

After long poking I found that the reason for this are the strict requirements of the UW tools for the format of the "From - ..." line in Unix email folders. This line marks the start of emails in a mailbox file. The format of the from line is:

From - WWW MMM DD HH:MM:JJ [Timezone] YYYY

where:
WWWWeekday
MMMAbbreviated name of month
DDDay of month
HH:MM:JJTime
YYYYYear
Mozilla begins Emails that have a date in the first 9 days of a month with only a single digit instead of two digits as expected by the tools of the University of Washington. UW tools expect either 05 or " 5" and require the format to be followed rigidly. The moz2imap tool changes the format so that Email from Mozilla can then be properly processed by pine, imapd and other tools of the University of Washington.

moz2imap is invoked with two parameters specifying the Mozilla folder to be read and the new folder to be generated:

moz2imap Mozilla-folder new-folder

moz2imap is available in a simple .c source file here. It can be build with:

gcc -o moz2imap moz2imap.c

Change Log

November 14, 2003: Initial Release

Last update November 14, 2003, Robert van Aven, robert[@]graphe.net.