I've struggled with enabling, and then disabling because of slowness, the
option for showing unread messages for all folders rather than just the
INBOX. Because of how slow the folders refresh, I finally gave up and
wrote the following script that does the work for me, then emails the
results, which I can then read to see where my filters have put new mail I
have yet to read.

< Start of Script (more of my dribble after) >

#!/bin/sh
DATA="^M"
dircnt=0
fldrcnt=0
##### Functions
chkit () {
 CHK=0
 CHK=`cat $i |grep "^Status: N"|wc -l`
 if [ "$CHK" -gt 0 ] ; then
   DATA="$DATA"`printf "\n$CHK: $i\n"`
 fi
}
##### Main program
# Check all 'first level' folders
cd /home/karlp/mail ; # could be  cd /home/$USER/mail
for i in `ls|grep ^[0-3,IN]` ; # changed to [0-9,a-z,A-Z]
 do
  ALLCHK="$ALLCHK***$i"
  if [ -d $i ]
   then
    dircnt=$(($dircnt+1))
  else
    fldrcnt=$((fldrcnt+1))
    chkit
  fi
done
if [ "$DATA" = '' ] ; then
  :
else
  LN=`printf "\n\n";printf "$dircnt Directories not checked\n";printf
"$fldrcnt
Folders checked\n"`
  DATA="$DATA$LN"
echo "$DATA"|mail -s "Report: Unread Emails" [EMAIL PROTECTED]
# or  echo "$DATA"|mail -s "Report: Unread Emails" [EMAIL PROTECTED]
fi

< End Of Script >
[ I have another script that also checks the main INBOX and only sends
everything if there's new email there. ]

This process is faster than using the option in SQM. I did a test just now
and it took about 4 minutes (me counting thousand-1, thousand-2...) to
have SQM do the count and about 13 seconds for the above script. Of
course, if you read bash scripts, you see that the above script only
searches for specific folders with a comment of how to check all folders.
I just modified the script so it looks at all folders and it took 93
seconds. That's still quite a bit faster.

I'm wondering if this type of process could be included in SQM? I've not
looked into the scripts that SQM uses as I'm not familiar enough with PHP
to know what/where to look. I even do my cgi in bash scripts...

I'm just trying to contribute something to an open source product I've
gotten pretty fond of. Thanks for putting up with me.

--
Karl Pearson
[EMAIL PROTECTED]
http://consulting.ourldsfamily.com
http://emailgroups.ourldsfamily.com
 If you don't think the dead come back to life, Be here at quitting time
 --
 My Thoughts on Terrorism In America: http://www.ourldsfamily.com/wtc.shtml
 --
 A right is not what someone gives you; it's what no one can take from you.
 -- Ramsey Clark




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
--
squirrelmail-users mailing list
Posting Guidelines: 
http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: squirrelmail-users@lists.sourceforge.net
List Archives: 
http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id=2995
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to