Unread counts for your Thunderbird accounts.
Watch Thunderbird mail folders and output unread totals in a simple, script-friendly format.
Thunderbird is great, but it does not expose a simple, stable way to read unread counts from the outside. If you want to feed a status bar, a panel widget, or a script, I found no good native way to do that.
tbunread reads Thunderbird's local IMAP index files and prints a compact list of unread totals, ordered exactly the way you want. It updates whenever files change and stays out of the way.
- Configure email accounts by creating symlinks in
ImapMail/tbunread(see Configuration) - Setup tbunread to run in the background (see Recommended setup)
- tbunread watches the default profile for changes
- Prints counts to stdout and optionally writes them to a file
- Emits
???when Thunderbird is not running
Install tbunread using Cargo:
cargo install tbunreadtbunread only processes accounts you explicitly link. Create a tbunread directory inside your Thunderbird profile's ImapMail directory, then add symlinks to each IMAP account directory. (POP3 is not supported.)
Example layout:
$ pwd
/path/to/.thunderbird/some.profile/ImapMail/tbunread
$ ls -lA
lrwxrwxrwx. (...) 01 -> ../mail.example1.com
lrwxrwxrwx. (...) 02 -> ../mail.example2.com
lrwxrwxrwx. (...) 03 -> ../mail.example3.comThe symlink names define the output order (alphabetical).
Print unread counts to stdout:
tbunreadWrite counts to a file:
tbunread --output /where/you/need/the/outputOnly write to a file (no stdout):
tbunread --quiet --output /where/you/need/the/outputAdjust the Thunderbird process scan interval (seconds):
tbunread --interval 10For continuous updates, run tbunread as a systemd user service:
[Unit]
Description=tbunread
[Service]
Type=simple
ExecStart=tbunread --output /where/you/need/the/output
Restart=on-success
RestartSec=5s
[Install]
WantedBy=default.target