I had to make a switch to Thunderbird as per ongoing transition in my office. I am working on Ubuntu 12.04. So i needed an easy way to move my pst files to Thunderbird format.

I found it is easy. Just need some tweaking.

1. Download the following packages.

sudo apt-get install libpst4
sudo apt-get install readpst

2.Now extract the contents of the PST file..Just create a new output directory, and run the readpst command.

readpst -r my_pst_file.pst - folder

If every thing goes smooth we will get a following directory structure

folder/folder 1/mbox
folder/folder 1/sub folder 1a/mbox
folder/folder 1/sub folder 1b/mbox
folder/folder 2/mbox
... etc.

Now, the thing to note here, is that Mozilla Thunderbird also uses the mbox format. So, now our data is in the right format, but not the right structure…. for Mozilla Thunderbird to make use of these mbox files, they need to be re-organised into a structure like this:

out/folder 1
out/folder 1.sbd/sub folder 1a
out/folder 1.sbd/sub folder 1b
out/folder 2
... etc.

3.Changing the folder structure has 3 commands explained below.

$> find out -type d | tac | grep -v '^out$' | xargs -d '\n' -I{} mv {} {}.sbd
$> find out -name mbox -type f | xargs -d '\n' -I{} echo '"{}" "{}"' | sed -e 's/\.sbd\/mbox"$/"/' | xargs -L 1 mv
$> find out -empty -type d | xargs -d '\n' rmdir

First, we need to rename all of the sub-directories to include the .sbd extension.

$> find out -type d | tac | grep -v '^out$' | xargs -d '\n' -I{} mv {} {}.sbd

Now, we rename the mbox files, and move then to their parents’ folders.

$> find out -name mbox -type f | xargs -d '\n' -I{} echo '"{}" "{}"' | sed -e 's/\.sbd\/mbox"$/"/' | xargs -L 1 mv

Okay, so that was a little bit harder 😉 And finally, we can remove any now-empty sub-directories.

$> find out -empty -type d | xargs -d '\n' rmdir

Thanks to http://colby.id.au/node/14

Leave a Reply

Your email address will not be published. Required fields are marked *