Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Read out Thunderbird unread mail? (linux, terminal)

I am about building a statusbar for dwm, i want to read out the unread-mail-count via terminal (with grep, sed, or fopen as a file) and get it via fopen/popen.

I am using ubuntu/dwm/thunderbird 16. I Think there is no text-file containing the unread-email count...

Any suggestions?

like image 951
Fabian Avatar asked Dec 30 '25 22:12

Fabian


2 Answers

go to ~/.thunderbird/default/

search in

Imapmail/../INBOX

or in

Mail/../INBOX

for files without any extension.They contain your mails.Do the following

cat <file>|grep -c X:Mozilla-Status: 0000

This will give you an unread mail count,since your unread mail have X:Mozilla-Status as 0000

For other statuses go through the different X:Mozilla-Statuses

like image 70
Iceman Avatar answered Jan 01 '26 12:01

Iceman


[NOT AN ANSWER]

I dont have enough rep to comment on the bellow answer (Anurag's answer). But grepping/counting for X:Mozilla-Status: 0000 isn't working anymore. I tried that for a conky script. even for unread the status is 0001. i have tested with ubuntu 12.10 and thunderbird 16. Here's the same question asked on getsatisfaction.com (external link).

You can also count "X:Mozilla-Status:" and "X:Mozilla-Status: 0001", both will return the same no matter what is the state of you inbox. It seems X:Mozilla-Status is not being used at all. (Ref.)

* I ran my searches for IMAP inbox. maybe that's the reason. maybe IMAP's info is stored somewhere else.

like image 21
Mohit Avatar answered Jan 01 '26 13:01

Mohit