Anti-spam, dodatno, Bayes, Pyzor
Zadnjih par dana se povećao broj spam poruka, pa moram da vidim kako to srediti.
Problem je što spam poruke nemaju ništa zajedničko (domen, pošiljalac, IP adresa, Subject), tako da ne vrede manuelne liste, nego moram još neki programčić da ubacim odozgo.
Provera šta je već instalirano
Napraviti neki fajl foo.txt, i nad njim isprobati sve :
# spamassassin -D < foo.txt
.....
May 13 09:17:48.126 [3900] dbg: razor2: razor2 is available, version 2.84
.....
May 13 09:17:56.158 [3900] dbg: pyzor: pyzor is not available: no pyzor executable found
.....
May 13 09:17:48.188 [3900] dbg: plugin: loading Mail::SpamAssassin::Plugin::Bayes from @INC
.....
Pyzor
Sajt gde se može videti malo više o Pyzor-u, i odakle se može skinuti.
# tar xvfz pyzor-0.5.0.tar.gz
# cd pyzorxxx
# python setup.py build
# python setup.py install
# pyzor discover
U fajl /etc/mail/spamassassin/local.cf dodati na kraj sledeću liniju :
pyzor_options –homedir /etc/mail/spamassassin
U taj folder sada staviti listu servera :
# pyzor –homedir /etc/mail/spamassassin discover
# service MailScanner restart
Proveriti da li Pyzor radi svoj posao :
# echo “test” | spamassassin -D pyzor 2>&1 | less
May 13 11:34:20.102 [15270] dbg: pyzor: network tests on, attempting Pyzor
May 13 11:34:28.055 [15270] dbg: pyzor: pyzor is available: /usr/bin/pyzor
…..
Bayes
Bayesian spam filtering is a statistical technique of e-mail filtering.
Kako proveriti da li imate Bayes, i da li on radi svoj posao.
Provera da li je tu :
# find / -name “bayes*” -print
/var/spool/MailScanner/spamassassin/bayes_toks.expire21460
/var/spool/MailScanner/spamassassin/bayes.mutex
/var/spool/MailScanner/spamassassin/bayes_toks
/var/spool/MailScanner/spamassassin/bayes_seen
/var/spool/MailScanner/spamassassin/bayes_journal
Ako su datumi na fajlovima današnji, onda radi.
Takoše se može pogledati i skor nad mail porukama :
…..
May 13 14:16:51 mail-2012 MailScanner[2458]: Message r4DCDkko002966 from 46.216.223.123 () to moj.domen is spam, SpamAssassin (not cached, score=9.956, required 6, BAYES_99 3.50, FSL_HELO_BARE_IP_1 2.35, FSL_HELO_BARE_IP_2 2.15, MSGID_FROM_MTA_HEADER 0.00, RCVD_NUMERIC_HELO 1.16, RDNS_NONE 0.79, TVD_RCVD_IP 0.00, TVD_RCVD_IP4 0.00)
…..
Da bi se promenili težinski faktori Bayes filtera, editovati fajl : /etc/MailScanner/spam.assassin.prefs.conf :
# score BAYES_00 -15.0
# score BAYES_05 -5.0
# score BAYES_95 5.0
# score BAYES_99 15.0
Dakle, othešovati, i staviti željene vrednosti, pa restartovati MailScanner.