you might want to look into my anti-repeat-spammer filter. It's designed to 
do just that,  Block a repeat-spammer until the next day. 
http://xmail.nomadcf.com


-- Chris L. Franklin --



----- Original Message ----- 
From: "Helio Cavichiolo Jr" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, November 21, 2005 8:31 PM
Subject: [xmail] Re: auto block spammer



Em Seg 21 Nov 2005 20:09, Sönke Ruempler escreveu:
> Not native in XMail. Just set up a SpamAssassin ;-)

I already have SpamAssassin installed, but it's not enought.
With this small script I caught 8 bad guys in 15 minutes. The script is 
called
by crontab every 5 minutes and every 23:59 (11:59 pm) I run the following
command to take them out of the punishment:
echo -n > /var/MailRoot/spammers.tab

Here goes the script:
============================
#!/bin/sh

spammer() {
  if [ $2 -gt 30 ]; then
    if [ ! "`grep \"^$1\/24\$\" /var/MailRoot/spammers.tab`" ]; then
      echo "$1/24" >> /var/MailRoot/spammers.tab
    fi
  fi
}

tail -n 1000 /var/MailRoot/logs/smtp-`date +%Y%m%d`0000 | \
sed 's/"//g' | cut -f3,4 | sort > /tmp/$$
while read ip datetime ; do
  if [ "$ip" = "$lip" ]; then
    let n=$n+1
  else
    if [ "$lip" ]; then
      spammer $lip $n
    fi
    n=1
    lip=$ip
  fi
done < /tmp/$$
rm -f /tmp/$$
if [ "$ip" ]; then
  spammer $ip $n
fi
==========================
Just it!
Helio
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]



________________________________________________________________________

This email was scanned by the server at NomadCF.com, And has been deemed 
clean of invaild and or dangerous email attachment type and virus'.

Although this is by no means a guarantee.
 
________________________________________________________________________
-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to