Bits and Chaos


Between bits and chaos, a sysadmin stands.

Import PST and DBX file into Thunderbird (or any other mail client)

Scenario: you have some .MBX or .PST files, and you want to import them into Thunderbird.

The easy way to accomplish requires the installation of Outlook/Outlook Express, then importing the files into this application, then firing up Thunderbird and using the Import menu (there’s also an extension, I’ve tested and doesn’t work). I don’t like this very much, as it requires the installation of another application; it would be better if Thunderbird could directly load an .MBX/.PST file, but this options is still lacking as of Thunderbird 3.1.1.

So I have devised another approach:

  1. Convert the .MBX/.PST file into mbox format: readpst (available for Linux, in Fedora 12 is in the libpst package) could handle the PST format, while DBXConv (available for Windows, AFAIK) could handle the MBX format; both of them will produce a standard MBOX file;
  2. Create a dedicated user for a Linux system, and copy the MBOX file produced in step 1 into /var/spool/mail/<username>;
  3. Install and configure dovecot to act as a POP3 server; from the standard configuration in Fedora 12, you have to change just a couple of paramaters in /etc/dovecot.conf: the first one is protocols, that you’ll set at pop3, the second is mail_location, that must be set at /var/spool/mail/%u (%u will be expanded to username, see the configuration file itself for more information);
  4. Start dovecot, check that firewall doesn’t block connections, etc…;
  5. Now on Thunderbird you could create a new account, that connect to the POP3 server, to download the content of the MBOX file; then you’ll select all the mails and copy then into a local folder.

This could be repeated for every file, when needed; also, the MBOX format is so good that you could concatenate multiple MBOX files into /var/spool/mail/<username> and then performing a single bigger import, maybe with some filters to dispatch incoming mails.

I’ve done this today for a friend of mine, and I’ve been able to import about 30,000 mails, from 1999 to today, coming from at least three different computers and multiple versions of Outlook and Outlook Express.

Of course, starting from now, he is kindly requested to use a mail client that natively support an open format.

Filed under: Uncategorized, , , , , , ,