I want to make a small plugin for awesome WM that will show a number of unread messages pending in Thunderbird. I want to fetch the number of messages accessing directly Thunderbird sqlite base. The question is: which base, table and fields should I query?
There are at least 15 bases under ~/.thunderbird/profile/
, including ./global-messages-db.sqlite
. In this base I tried messageAttributes
table, but with no big success. I could not find development documentation describing the attributes...
Any help here?
You will find what you need in the global-messages-db.sqlite
file. If you watch the messages
table, you will find a column jsonAttributes
. In there you will find a JSON array, from attribute ids and their value. The key 58 is the read-status of a message. So if you find something like {"58": false}
in this column the message is still unread. But this database won't be updated immediately when a new message is received. (It might even be updated only, when you close Thunderbird -- I am not sure about that.)
So as you see finding unread messages that way will be a bit of the hard way to go. I would recommend you to better create a plugin, that is directly checking the server via IMAP or POP3.
For IMAP servers there already exist an awesome-plugin inside the Delightful Extensions. I don't know of any POP3 plugin, and as it seems POP3 libs for lua are also rare to find.