Rebuild Thunderbird Indexes Script

Rebuild Thunderbird Indexes

Every now and then my Thunderbird seems to take ages to load a message, or seems to get caught up initialising itself. After a bit of searching, there seemed to be two different issues; the global message database and possibly the indexes for each folder.

Here’s the small script I wrote that will remove the global message database and all folder indexes. It’s written for *nix systems, so it assumes that Thunderbird’s home directory is ~/.thunderbird  (that is, a directory called thunderbird in your home directory).

If the directory doesn’t exist, it’ll just exit.

Make sure that Thunderbird is not running when you run this.

# force Thunderbird to rebuild all it's indexes and global message log



if [ !  -d $TBDIR ]
    echo Cannot find thunderbird directory

    echo checking for global message database $GBL
    find $TBDIR -name $GBL -exec rm {} \;

    echo Searching for folder index files
    find $TBDIR -name "*msf" -exec rm {} \;


1,914 total views, 2 views today

Hi - Please leave a comment