Adicionar usuário e grupo para o daemon do spamassassin:
# groupadd spamd
# useradd spamd -g spamd -s /bin/false -d /home/spamassassin -c 'Spam Assassin'
# mkdir /home/spamassassin -p
# chown spamd.spamd /home/spamassassin -R
Instalar:
# perl -MCPAN -e shell
cpan> install ExtUtils::MakeMaker
cpan> install File::Spec
cpan> install Pod::Usage
cpan> install HTML::Parser
cpan> install Sys::Syslog
cpan> install DB_File
cpan> install Net:

NS
cpan> install Mail::Audit
cpan> install Mail::Internet
cpan> install Net::SMTP
cpan> install Digest::SHA1
cpan> install Net::Ident
cpan> install Mail::SpamAssassin
Se algum dos modulos acima não instalar ou retornar erro force a instalação:
# cd ~/.cpan/build/nomedomodulo
# make install
Criar /etc/rc.d/rc.spamd um script de inicialização:
#!/bin/sh
spamd_start(){
spamd -x -u spamd -H /home/spamassassin -d
}
spamd_stop(){
killall spamd 2>/dev/null
killall spamd 2>/dev/null
}
spamd_restart(){
spamd_stop
spamd_start
}
case '$1' in
'start')
echo -n 'iniciando SpamAssassin ... '
spamd_start
echo OK
;;
'stop')
echo -n 'finalizando SpamAssassin ... '
spamd_stop
echo OK
;;
'restart')
echo -n 'reiniciando SpamAssassin ... '
spamd_restart
echo OK
;;
*)
echo 'Use: $0 start/stop/restart'
;;
esac
Torne executável:
# chmod +x /etc/rc.d/rc.spamd
Inicie o spamassassin:
/etc/rc.d/rc.spamd restart
Adicione no rc.local
# joe /etc/rc.d/rc.local
/etc/rc.d/rc.spamd start
Prontinho agora e so configurar o /etc/mail/spamassassin/local.cf abaixo segue um exemplo de uma configuração minha derrepente a galera tem mais sugestoes:
# This is the right place to customize your installation of SpamAssassin.
#
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
# Only a small subset of options are listed below
#
################################### ################################### #####
# Add *****SPAM***** to the Subject header of spam e-mails
#
# rewrite_header Subject *****SPAM*****
# Save spam messages as a message/rfc822 MIME attachment instead of
# modifying the original message (0: off, 2: use text/plain instead)
#
report_safe 1
# Set which networks or hosts are considered 'trusted' by your mail
# server (i.e. not spammers)
#
# trusted_networks 212.17.35.
# Set file-locking method (flock is not safe over NFS, but is faster)
#
# lock_method flock
# Set the threshold at which a message is considered spam (default: 5.0)
#
required_score 4.0
# Use Bayesian classifier (default: 1)
#
use_bayes 1
# Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
use_dcc 1
use_pyzor 1
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages all
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all
# Set headers which may provide inappropriate cues to the Bayesian
# classifier
#
# bayes_ignore_header X-Bogosity
# bayes_ignore_header X-Spam-Flag
# bayes_ignore_header X-Spam-Status
Não esqueça que pra esse tipo de configuração voce tera que descomentar algumas linhas referente ao razor,pyzor e dcc nos arquivos v310.pre, v312.pre e v320.pre que por default vem comentadas.
Abração