I have backup folders of emails that I downloaded from an old server running Exim. I can open all the files in a text editor and read the contents and they are in standard RFC 822 format.

The filenames look like this:


Ultimately I need to import them into a Google Apps account. It's a free account so I can't use the python apps API method which would work if I added a .txt file extension. Google has Mac Email Uploader but it requires the email to be in one of the following:

  • Apple Mail: ~/Library/Mail
  • Eudora: ~/Eudora Folder -Thunderbird: ~/Library/Thunderbird

When I try to import the messages into Apple Mail or Thunderbird they are not recognized. I have tried adding a .mbox file extension and a .txt file extension. I have also ran this bash script but it converted them all into one big file with a .mbox extension that can't be read by any of the clients.

if [ $# == 0 ]; then
echo usage ${0##*/} FolderName
exit 0

for file in `find "$1" -type f`; do
   cat "$file" | formail >> "$mbx"
  • 1
    Looks like standard Maildir filenames - could you install a pop server like Dovecot, drop the files into you Maildir/new folder and then point Google apps at this (temporary) mail server to grab the mails? – barryj May 6 '11 at 21:48

According to the page you linked to,

The Google Email Uploader for Mac is a desktop utility for Mac OS X that uploads email archives from Apple Mail, Eudora, Thunderbird, and exported Entourage mail (along with other mbox and Maildir archives) to your Google Apps mailbox.

What you have is Maildir, but from your given example it seems the names have been mangled during the transfer: the 2,S suffix is supposed to be separated by a : (or ; in some systems), not by /.

The output of your mbox conversion script should be accepted directly by Uploader, too.

find "$dir" -type f | while read name; do
    formail < "$name" >> "$mbox"
  • It worked adding the entire Maildir folder that included all the mailboxes. – Chris_O May 8 '11 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.