Generate simple but beautiful analytics of your Thunderbird email account

Thunderbird Email Stats

Generate simple but beautiful analytics of your Thunderbird email account

IMPORTANT This project only gets security updates, since its functionality was ported to a native Thunderbird add-on. The three main reasons for the switch: This project depends on the mail storage engine, the stats creation process is a little too complex and the stats page cannot be accessed directly from Thunderbird.

Get started

This toolkit uses Python to retrieve the data from your Thunderbird mail account and store it in json format and a Vue.js based web application to present the data in numbers and charts.

Installation

Make sure, you have at least Python 3.6 installed with the tqdm package

$ python --version
Python 3.6.9
$ pip install tqdm
...

Clone this repository and enter its root directory:

git clone https://github.com/devmount/thunderbird-stats
cd thunderbird-stats

Install all dependencies:

yarn

Make the Python script executable:

chmod +x ./stats.py

Configuration

Before using this tool, you have to set two settings in the config.ini: The file path to your Thunderbird profile email account and your own email address(es) for the Python script to recognize, which emails were sent or received. You can determine your email account file path by right-clicking on your Thunderbird account > Settings > Server-Settings > Scroll to the bottom. Your email addresses are comma seperated without spaces. See this example:

[email]
ThunderbirdAccountPath = /path/to/Thunderbird/Profiles/abcdefg.default/ImapMail/account
EmailAddresses = your@email.com,test@email.com

IMPORTANT Unfortunately your Thunderbird account must be configured as maildir, where each message is stored as a seperate file. This tool won’t work with mbox accounts. maildir is on it’s way to become the default mail storage format, but until than the Thunderbird team discurages the use of maildir (though I personally use it for more than a year and never had problems with it).

Usage

Now that everything is set, you can run the Python script. A progress indicator will show you, how many emails are processed and how long it will take to finish. This could be a possible output:

$ ./stats.py
Processing mails...
100%|██████████████████████████████████| 26812/26812 [00:13<00:00, 1924.08mails/s]
Finished.

Once finished, all data files are created in the /src/data directory in json format. Now you can either start the development server and find your stats at localhost:8080

yarn serve

… or create an optimized production build with minification. All build files can be found in the dist directory and you can open the index.html file to find your stats.

yarn build

Additional notes

  • Keep in mind, that the processing of large mailboxes can take a lot of time.
  • Unfortunately there is no unified email date format, so it’s very likely that the Python script will not recognize all of your emails. If you encounter an unsupported date format, please issue a bug report.

Licence

MIT License


or sponsoring me for further development. ?

GitHub

View Github