At 01:02 PM 8.18.2003 +0200, Luca Benassi wrote: >Hy, >is there a way to count spam? >I just need to get the number of mails tha SA tags as spam, for each user >in my system. > >I've searched the docs, faq, ecc but ... :( > >Thank you, >Luca >
Here is how I do mine for all spams, but you could easily modify to run for each user. Also, my script does more than just count spams, so I carved out the counting portion for you. Again, just use the portion you need to do the count: #!/bin/sh PATH=/usr/local/bin:/usr/bin:/bin cd /usr/samba/mail # #Change the variables below to fit need DATED=`date +.%m%d%y` DATEM=`date +.%m%y` SPAMSH=sa_spam-h${DATED} SPAMLIST=spamlist${DATED} SPAMARCHIVE=spamarchive${DATEM} COUNTMONTH=countmonth${DATED} ACCUMQTY=accumqty${DATED} # /bin/ls -laFo > $SPAMLIST # cat $SPAMSH >> $SPAMARCHIVE /usr/bin/grep "X-Spam-Status:" $SPAMSH > totalspams # /bin/date >> qtyspams /usr/bin/wc -l totalspams >> qtyspams mail -s "Qty of Spams Today" < qtyspams [EMAIL PROTECTED] # /usr/bin/grep "X-Spam-Status:" $SPAMARCHIVE >> $COUNTMONTH /usr/bin/wc -l $COUNTMONTH >> $ACCUMQTY mail -s "Accum Qty Spams - Sage-American" < $ACCUMQTY [EMAIL PROTECTED] # Best regards, Jack L. Stone, Administrator Sage American http://www.sage-american.com [EMAIL PROTECTED] ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk