Unread mail count from qdbus

Aleix Pol aleixpol at kde.org
Mon Oct 17 00:06:55 BST 2016


On Sun, Oct 16, 2016 at 8:59 PM, Daniel Vrátil <dvratil at kde.org> wrote:
> On Sunday, October 16, 2016 7:50:46 PM CEST CoD wrote:
>> Hi everyone,
>
> Hi,
>
>> I'm trying to retrieve the number of unread mails in kmail/akonadi from a
>> bash script but I'm having troubles understanding qdbus.
>>
>> I'm looking for something simple: I'd be happy even with a "boolean" answer
>> such as "yes there are new mails" or "no, nothing new".
>>
>> I have many accounts, both imap and local, but I need just to know if one of
>> them has unread emails.
>>
>> I've explored qdbus a bit but I can't figure out neither if I should call
>> akonadi or kmail nor what's the right method to call, so I decided to bother
>> you... sorry for that ;-)
>
> Unfortunatelly right now there is no API to get such information via DBus or
> command line.
>
> The only chance for you right now is to write a tiny utility using the Akonadi
> C++ API to retrieve the information. Just let me know if you want some hints
> on how to do this, it would not be more than ~20 lines of C++.
>
> Dan
>
>>
>> Any help is appreciated :-)
>>
>>
>> Thank you
>>
>>
>>
>> CoD
>
>
> --
> Daniel Vrátil
> www.dvratil.cz | dvratil at kde.org
> IRC: dvratil on Freenode (#kde, #kontact, #akonadi, #fedora-kde)

Maybe it's available from the status notifier?

Aleix



More information about the kde-pim mailing list