I haven't written anything up (maybe I should) but it's easy enough.
In Thunderbird, go to Help -> Troubleshooting Information -> Profile Directory.
That opens your profile directory. In there is a file global-messages-db.sqlite that holds all your messages. Treat that as read-only. If it does get messed up for some reason, you can delete it. It's an index that will get rebuilt.
If you close Thunderbird, you can open the db in sqlitebrowser to view the tables. Some tables I've used for queries:
folderLocations - tells you the id of each email folder
messages - metadata for each message
messagesText_content - subject, recipients, body of each email message
conversations - info about your email threads that can be matched with data in messages to retrieve full email threads
In Thunderbird, go to Help -> Troubleshooting Information -> Profile Directory.
That opens your profile directory. In there is a file global-messages-db.sqlite that holds all your messages. Treat that as read-only. If it does get messed up for some reason, you can delete it. It's an index that will get rebuilt.
If you close Thunderbird, you can open the db in sqlitebrowser to view the tables. Some tables I've used for queries:
folderLocations - tells you the id of each email folder
messages - metadata for each message
messagesText_content - subject, recipients, body of each email message
conversations - info about your email threads that can be matched with data in messages to retrieve full email threads