Grazie a ziobudda ho scoperto questo interessante giochino, ossia insegnare a spamassasin da un’archivio di mail di spam, dato che pero le mail sono tante ci vuole anche uno script che vi riporto qui sotto visualizzato da GESHI
#!/bin/sh
# spamlearn -- paolo(AT)psycostudio.org -- modificato da yoghi(AT)sigmalab.net
#
# The spamlearn is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#
SPAMARCH="/var/cache/spam"
root () {
if [ x"`id -u`" != "x0" ] ; then
echo "Errore: Lo script puo essere avviato solamente come utente root"
exit 1
fi
return 0
}
download_spam() {
cd $SPAMARCH
echo -n "Sto scaricando l'archivio..."
if [ `wget -N -r -nd -o $SPAMARCH/wget-log ftp://spamarchive.org/pub/archives/submit/ &` ]; then
echo "Errore";
else
echo "Ok"
fi
}
spamlearn() {
echo "Starting spamlearn() (Spamlearn)..."
/etc/init.d/postfix stop
/etc/init.d/spamd stop
cd $SPAMARCH
if test ! -f "$SPAMARCH/spam_checked"; then
touch $SPAMARCH/spam_checked
fi
for i in *.gz;
do
## Controllo se esistono dei file di Spam.
if [ $i != "*.gz" ]; then
CHECK=`cat $SPAMARCH/spam_checked | grep $i`;
if [ "$i" != "$CHECK" ]; then
echo -n "Sto processando il file $i: "
if [ `gunzip -c $i > /tmp/spam$i.file | sa-learn --spam --showdots --mbox /tmp/spam$i.file` ];then
echo "C'e un errore con il file $i"
else
echo "E' stato controllato il file $i"
`echo $i >> $SPAMARCH/spam_checked`
`rm /tmp/spam$i.file`
fi
else
echo "Skip: Il file di spam $i, gia controllato.";
fi
else
echo "Non ci sono files di spam da controllare."
fi
done
/etc/init.d/spamd start
/etc/init.d/postfix start
}
start() {
download_spam || true
spamlearn || true
}
trap 'echo "Trap-handler: Terminazione controllata del processo..."' 2
if [ -x $SPAMARCH ] ; then
start
echo
else
echo "Errore: Non esiste la directory $SPAMARCH"
echo "Creo la directory specificata"
mkdir $SPAMARCH
start
fi