Import Thunderbird to Zimbra Desktop

Zimbra DesktopI  just moved from Thunderbird (Postbox actually, but that’s a story for another time) to Zimbra Desktop. The biggest issue quickly became the ability to take my old POP3 mail with me since Thunderbird doesn’t have an export feature and Zimbra Desktop only has basic import functionality. Despite the Zimbra forums regularly proclaiming that IMAP accounts are the solution, that didn’t work for me since I needed to take email from an old POP account and move it to the same POP account in ZD. It quite a while to figure out, but here’s how to do it:

(Note: Postbox uses the same storage system as Thunderbird, so these instructions will work there too.)

Thunderbird Compact Folders1. Make a backup. No, really. I’m not sure how your old email could get damaged in this process, but do you really want to be the one to get credit for figuring that out?

In Thunderbird, go File > Compact Folders. Then open up c:\Documents and Settings\[User Name]\Application Data\Thunderbird\Profiles\[Profile ID]\Mail\ and back up the contents. If you will be using this process to migrate IMAP data, be sure to back up the ImapMail folder too.

2. With that out of the way, we need to convert your emails from MBOX format  to the EML format which ZD can import. Either of the following options will work:

Option A (easiest). If you don’t mind the dates in your Zimbra browse pane showing the export date (the date will still be correct when you open the actual email), download and install SmartSave, a Thunderbird addon. Then right-click on each account and/or folder you want to export, and select “Export this folder with SmartSave”. Save the files to a temporary folder you set up for the process as so we can work with them in the next step.

Option B. If like me you have thousands of emails that just won’t be useful to you if the dates are messed up, you are going to need to download a little program called mbx2eml. It does the same thing as SmartSave, but keeps the dates intact. Oh, and it takes a few extra steps. There are simple step-by-step instructions in the download, so I’m not going to repeat those here.

3. Next we need to take the EML folders and files you just created and put them in a tgz archive since that’s what ZD expects them to come in. You can use any program you like; I used PeaZip (when it comes to utilities, I like mine portable). In PeaZip and many similar programs, creating a .tgz archive is a two step process: you will first need to add the files to a TAR archive, and then archive that TAR archive as a GZip archive. The folder structure you archive is the one that will be imported (including the root folder if that’s what you archive).

4. Finally, we import the data. Open Zimbra Desktop to the account you want to import the email to, click Preferences (aka Options) > Import/Export, and in the Import area browse to the location of your .tgz or .tar.gz archive. Once you’ve selected the file, click Import and go back to work (when you are doing a large import, Zimbra lets you keep using your mailbox while it quietly keeps importing data).

Zimbra Desktop Import

It’s not an elegant process, it’s not fast; but it works. I’ve imported data for several accounts this way, with the largest archive containing well over 1GB worth of email and attachments (after I’d done some cleaning).

Here are the obligatory version numbers of the software I used:

  • Windows XP SP3
  • Thunderbird 2.0.0.23
  • mbx2eml 0.68
  • Zimbra Desktop 1.0.3
  • John Smith

    This manual is very useful. I was able to migrate from thunderbird to zimbra so easily. It is a must-have for everyone

  • Lorenzo Gitto

    Hello Everyone,
    Procedure works very well but date showed in Zimbra panel are just the imported day date. So I miss the original date!! What happend? I used mbx2eml
    Thank you to you all

  • Aris

    Greetings, Zimbra desktop 1.0.4 refuses to import.

    I managed to convert some mails to .msg format. I created a Test folder, I archived it to tar and the to gzip.

    I press import on Zimbra, it say Import complete but no mails appear.

  • Marijan

    Hi!
    I’m trying to import inbox from Thunderbird to Zimbra Web Client. All steps but the final one work well. Zimbra says that importing was successfull, but nothing happens in inbox. I can’t see any imported mail. Nor is the size (in MB) of the inbox larger.
    I noticed that when I export my inbox from Zimbra, it creates bot msf and meta file for each e-mail. But when creating eml files with mbx2eml I don’t get any meta files. Could that be the problem?
    I would be very thankful for some answer.

  • Rick vV

    The Import process went fine, and most of the dates remained as they were, but some messages picked up the time that the mbx2eml process ran (Win7 64bit, Zimbra Desktop 1.04, Thunderbird v3).
    Thanks for the tutorial

  • Your instructions made the import process a walk in the park. Had a bit of a problem using the mbx2eml utility. The SmartSave addin worked for me.

    Just one thing to note when importing your mail. The folder names have to be unique. Some of my personal folders were not imported the first time. A second import renamed all the folders and a manual move and attempt to rename the moved folders highlighted an issue with duplicate names (identical names in different parts of the folder structure).

  • I Did a small shell script as a work around concerning the date showed in Zimbra panel are just the imported day. It’s change the date of the EML files after the conversion from mbox file…

    #! /bin/sh
    REP_SOURCE=”/PathToYourEMLFolder”
    find ${REP_SOURCE} -type f | while read A ; do
    echo $A ;
    grep -m 1 Date “$A” | while read TD; do
    echo “======== On a la date ! =======”;
    DD=$(echo $TD | awk ‘{ print substr($O, 12, 2)}’);
    Month=$(echo $TD | awk ‘{ print substr($O, 15, 3)}’);
    YYYY=$(echo $TD | awk ‘{ print substr($O, 19, 4)}’);
    HH=$(echo $TD | awk ‘{ print substr($0, 24, 2)}’);
    MM=$(echo $TD | awk ‘{ print substr($0, 27, 2)}’);
    case $Month in
    Jan) MM=01 ;;
    Feb) MM=02 ;;
    Mar) MM=03 ;;
    Apr) MM=04 ;;
    May) MM=05 ;;
    Jun) MM=06 ;;
    Jul) MM=07 ;;
    Aug) MM=08 ;;
    Sep) MM=09 ;;
    Oct) MM=10 ;;
    Nov) MM=11 ;;
    Dec) MM=12 ;;
    esac
    echo $YYYY$MM$DD$HH$MM;
    touch -t $YYYY$MM$DD$HH$MM “$A”;
    done
    done

  • Hi,

    I change the code because the days from 1 to 9 were not wotking with the first version…

    #! /bin/sh
    REP_SOURCE=”/PathToYourEMLFolder”
    find ${REP_SOURCE} -type f | while read A ; do
    echo $A ;
    grep -m 1 Date “$A” | while read TD; do
    Length=$(echo ${#TD})
    if [ $Length -eq 38 ] ; then
    echo “======== Jour a 2 chiffres ! =======”
    DD=$(echo $TD | awk ‘{ print substr($O, 12, 2)}’)
    Month=$(echo $TD | awk ‘{ print substr($O, 15, 3)}’)
    YYYY=$(echo $TD | awk ‘{ print substr($O, 19, 4)}’)
    HH=$(echo $TD | awk ‘{ print substr($0, 24, 2)}’)
    MM=$(echo $TD | awk ‘{ print substr($0, 27, 2)}’)
    else
    echo “======== Jour a 1 chiffre ! =======”
    DD=0$(echo $TD | awk ‘{ print substr($O, 12, 1)}’)
    Month=$(echo $TD | awk ‘{ print substr($O, 14, 3)}’)
    YYYY=$(echo $TD | awk ‘{ print substr($O, 18, 4)}’)
    HH=$(echo $TD | awk ‘{ print substr($0, 23, 2)}’)
    MM=$(echo $TD | awk ‘{ print substr($0, 26, 2)}’)
    fi
    case $Month in
    Jan) MM=01 ;;
    Feb) MM=02 ;;
    Mar) MM=03 ;;
    Apr) MM=04 ;;
    May) MM=05 ;;
    Jun) MM=06 ;;
    Jul) MM=07 ;;
    Aug) MM=08 ;;
    Sep) MM=09 ;;
    Oct) MM=10 ;;
    Nov) MM=11 ;;
    Dec) MM=12 ;;
    esac
    echo $YYYY$MM$DD$HH$MM;
    touch -t $YYYY$MM$DD$HH$MM “$A”;
    done
    done

  • Hi, I’m trying to import emails from Thunderbird to Zimbra Desktop version 2.0.1. I’m not using any plugins, instead, I use built-in save function (file-save as) in Thunderbird. I tried some folder structures in the tar.gz archive but it always end up with ‘Not allowed to import to root folder for this type’ when I import it in zd. Is it different saving with built-in save function with using save/export function provided by the plugins?

  • Francois

    Actually there is a newer thunderbird export plugin named ImportExportTools, see:
    http://nic-nac-project.de/~kaosmos/mboximport-en.html
    It includes the option to set the file timestamp equal to mail date. By default it’s off, to set it go to menu Tools>ImportExportTools>Options>Add date to the file properties

  • Francois

    Also, I had to make sure the file was ending with .tgz instead of .tar.gz to import properly

  • For a family vacation, that is. The Miami Heat star said that’s Cheap Nike Free Run first order of
    business, and during the time away from basketball he’ll start the process of
    moving past this season and looking toward the future. “I just want to win.
    That’s all that matters to me,” Cheap Nike
    Air Max said Tuesday after emerging from the final team meeting, one where
    coach Erik Spoelstra urged his team take plenty of pride from the season, even
    though the end result was an NBA Finals loss to San Antonio. “I haven’t even
    begun to even think about what my future holds or what Nike Air Max 1
    have in store. I will sit down with my team at some point, my family as well.
    Today definitely wasn’t the day. “If my family is happy, then I’m happy and able
    to perform at a high level.” If so, then they’ve been happy during Air Max 2014
    first four years in Miami: James has been to the NBA Finals all four seasons in
    which he’s played for the Heat, capturing two championships, and no one in the
    league over that span has logged more minutes, made more field goals or Nike Blazers For
    Sale more games than the four-time MVP

  • Rick Steves

    If you are still getting the same issue you can use one of the third-party tool, as i am a happy users of this tool its help in moving all my Thunderbird emails to Zimbra desktop by using MBOX to Zimbra email migration tool you can get the tool from here http://goo.gl/rSnCCO

    Hope this tool helps you to migrate all your emails to Zimbra mail environment.