Thursday, April 29, 2010

How to view messageText table for command line or any tools

Thunderbird 3 or later uses SQLite3 to index mail body for "Gloda" full-text search. Gloda uses custom tokenizer "mozporter" to support non-ASCII characters. So when you open global-messages-db.sqlite, you cannot view a data into some tables such as messageText.

There is the way to view messageText table for command line version of SQLite3.

Before you try this, you should backup your database file!

  1. Get the module address for porter tokenizer
    sqlite> select hex(fts3_tokenizer('porter'));
    00EF420A8C7F0000
    
  2. Register dummy "mozporter" with same address of porter
    sqlite> select fts3_tokenizer('mozporter',X'00EF420A8C7F0000');

Then, you can view a data into messageText using SQL.

No comments: