On Thursday 21 February 2002 23:29 pm, Douglas J Hunley wrote:
> >�I put everything from 5 to 10 points into a special mailbox to look at.
> >�(might be some good mail in there but hardly ever) � Everything 10 and
> >�above I now send to /dev/null. � In the last two weeks I've sent �709
> >�emails to /dev/null. �Don't even have to bother with them.
>
> how'd you do that? Right now I have 'X-Spam-Staus: Yes' going to special
> folder. Love to see how you interrogated the 'hits=' value

==============Start of recipe================

#get rid of spammers 

:0fw
| spamassassin -P

:0e
{
  EXITCODE=$?
}

#  Send everything hits=10 and above to dev/null  but count them
:0
* ^X-Spam-Status:.*hits=[1-9][0-9]
{
:0 c
| /usr/local/bin/cntspam

:0
/dev/null
}

#  Put everything hits=5 to 9  in  lowspam
:0:
* ^X-Spam-Status:.*hits=[5-9][\ \.]
/var/spool/mail/lowspam


============End of recipe=======================

/usr/local/bin/cntspam
===================
#!/usr/bin/perl
@all = <stdin>;  # dump the mail file to prevent an error.
open spam_cnt, "/var/spool/mail/spamcnt"  or die "Can't open spamcnt\n";
$cnt =  <spam_cnt>;
close spam_cnt;
chomp($cnt);
print ("$cnt\n");
$cnt = $cnt + 1;
open spam_cnt, ">/var/spool/mail/spamcnt"  or die "Can't open spamcnt\n";
print spam_cnt "$cnt\n";
close spam_cnt;


(you'll note I'm no big perl expert...  <blush> )

-- 
+----------------------------------------------------------------------------+
+ Bruce S. Marshall  [EMAIL PROTECTED]  Bellaire, MI         02/22/02 00:23  +
+----------------------------------------------------------------------------+
"Everyone has photographic memory, some don't have film!"
_______________________________________________
Linux-users mailing list - http://linux-sxs.org/mailman/listinfo/linux-users
Subscribe/Unsubscribe info, Archives,and Digests are located at the above URL.

Reply via email to