[kde-linux] How to check kmail has some unread mails ?
christophe
christophe.dr at free.fr
Tue Mar 27 20:47:23 UTC 2007
Le Mardi 27 Mars 2007 15:06, Kevin Krammer a écrit :
> On Tuesday 27 March 2007 14:49 +0100, christophe wrote:
> > Le Mardi 27 Mars 2007 14:41, Kevin Krammer a écrit :
> > > On Tuesday 27 March 2007 13:59 +0100, christophe wrote:
> > >[...]
> > > % dcop kmail KMailIface folderList | while read folder; do dcop $(dcop
> > > kmail KMailIface getFolder $folder) unreadMessages; done
OK thanks a lot Kevin, here is what i have now :
#!/bin/sh
numberOfMail=0
dcop kmail KMailIface folderList | while read folder; do
#echo $folder
if [ "$folder" = "/Local" ]
then
echo "local" # do nothing
else
numberInFolder=$(dcop $(dcop kmail KMailIface getFolder "$folder")
unreadMessages )
echo $numberInFolder
numberOfMail=$[$numberOfMail + $numberInFolder]
echo $numberOfMail
fi
done
echo "Number of mail is :
echo $numberOfMail
I have added a few extra echo to check what is happening during the
My problem is that the number of email displayed at the end is 0 .
--
christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-linux/attachments/20070327/787d8a7b/attachment.sig>
More information about the kde-linux
mailing list