Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Querying Thunderbird's SQLite message database from C#

I want to query email messages stored by Thunderbird from a C# application I am developing.

Currently I can get some message parts such as From address and Subject by querying the SQLite database, global-messages-db.sqlite.

SELECT subject FROM messagesText LIMIT 10;

I have not been able to locate the body of messages. I have searched for documentation of Thunderbird's storage but I can't find anything that describes where this is stored.

Where are the bodies of messages stored?

like image 858
Liam Avatar asked Jul 04 '12 16:07

Liam


Video Answer


1 Answers

From my own experimentation, it seems you can get the list of messages with the below.

select * from messages;

In that result set, you'll notice each message has an id. To get the content of a particular message you can do the following.

select c0body,c1subject,c2attachmentNames,c3author,c4recipients from messagesText_content where docid = 1234;

This is assuming the id of the message you want is 1234.

like image 145
Nerdtron Avatar answered Sep 29 '22 19:09

Nerdtron