Unread mail count from qdbus

Daniel Vrátil dvratil at kde.org
Sun Oct 16 19:59:38 BST 2016


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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20161016/4d8ce7ff/attachment.sig>


More information about the kde-pim mailing list