Un server di posta con qmail su FC6 (parte 8)
In questo articolo, installiamo tutti i software necessari alla gestione dello SPAM, ovvero della posta indesiderata, che affligge tutti coloro che hanno una casella di posta elettronica. Per il momento, configureremo soltanto il sistema in sé, che non eliminerà ancora le nostre email di SPAM. Infatti, è necessario ancora un altro passaggio, che effettueremo solo dopo aver installato anche l’antivirus, che consiste nel mettere in connessione il nostro server di posta con questi sistemi di rilevazione SPAM e Virus/Trojan/Worm/Malware in generale…
Livello: medio/avanzato
Technorati Tags: qmail, vpopmail, mysql, qmailadmin, squirrelmail, clamav, spamassassin, antivirus, qmail-scanner, ezmlm, posta elettronica, email, linux, fedora, fc, core
Â
Iniziamo con l’installazione di Razor v2 (che supporterà spamassassin per il riconoscimento dello SPAM), rispondendo alle domande che ci saranno poste (accettare le risposte di default, tranne il Country)
perl -MCPAN -e shell
Si aprirà la shell perl, dalla quale eseguiamo i seguenti comandi:
o conf prerequisites_policy follow
 install LWP MD5
 install Net::Ping Net::DNS Time::HiRes Digest::SHA1 Getopt::Long File::Copy Digest::Nilsimsa URI::Escape
 quit
Dopo di che procediamo con il download e l’installazione di razor:
cd /usr/src/pacchetti/tar/
wget http://optusnet.dl.sourceforge.net/sourceforge/razor/razor-agents-2.84.tar.bz2
cd ..
tar xjvf tar/razor-agents-2.84.tar.bz2
cd razor-agents-2.84
perl Makefile.PL
make
make test
make install
cd ..
spamassassin userà /usr/bin/razor-check durante la rilevazione dello SPAM.
Creiamo i files di configurazione di razor (accertarsi che non vi siano filtri di rete)
razor-admin -d -create -home=/etc/razor
Abbassiamo, eventualmente, il livello di debug per evitare il sovraccarico eccessivo per il logging:
vi /etc/razor/razor-agent.conf
->Â Â Â Â Â Â Â debuglevel=1
e procediamo con l’installazione dei moduli perl che costituiscono un prerequisito x spamassassin:
perl -MCPAN -e shell
o conf prerequisites_policy follow
install Digest::SHA1 HTML::Parser Storable MIME::Base64 DB_File Net::DNS Net::SMTP Mail::SPF::Query IP::Country::Fast BerkeleyDB
exit
Iniziamo l’installazione vera e propria di spamassassin:
cd /usr/src/pacchetti/tar/
wget http://apache.fagioli.biz/spamassassin/source/Mail-SpamAssassin-3.2.0.tar.bz2
cd ..
tar xjvf tar/Mail-SpamAssassin-3.2.0.tar.bz2
chown -R root.root Mail-SpamAssassin-3.2.0
cd Mail-SpamAssassin-3.2.0
perl Makefile.PL
make
make install
Fatto! SpamAssassin è installato. Per testare che funzioni, eseguiamo il seguente comando e cerchiamo, nell’output mostrato, di vedere se c’è il tag Spam-Status: YES/NO)
spamassassin -t < sample-nonspam.txt
(qui dovremmo trovare Spam-Status: NO)
spamassassin -t < sample-spam.txt
(qui, invece, dovremmo trovare Spam-Status: YES)
Se tutto va come illustrato, creiamo un utente per spamassassin:
groupadd spamd
useradd -g spamd spamd
e modifichiamo la configurazione di base di spamassassin
vi /etc/sysconfig/spamassassin
 # Hint : if you want to enable SpamAssassin debugging
 # (the debug output goes to /var/log/maillog) then use :
 # SPAMDOPTIONS=”-x -u spamd -H /home/spamd -d -D”
 # Don’t leave debugging turned on unnecessarily though,
 # because it will slow down a busy server.
 #
 # Otherwise, for normal operation (debugging disabled) use following combo :
 # -x means not to look for any per-user preferences ( since all our users are virtual)
 # -u means to run as userid spamd
 # -H tells the addon apps like .razor to store all their files into eg /home/spamd/.razor
 # -d tells spamd to run as a daemon
 SPAMDOPTIONS=”-x -u spamd -H /home/spamd -d”
Infine, predisponiamo l’avvio automatico:
chkconfig –level 345 spamassassin on
oppure:
 cp spamd/redhat-rc-script.sh /etc/rc.d/init.d/spamd
 chmod 700 /etc/rc.d/init.d/spamd
 cd ..
 chkconfig –add spamd
Sistemiamo ulteriormente la configurazione, che potremo meglio comprendere ricorrendo alla documentazione di SpamAssassin (perldoc Mail::SpamAssassin::Conf o man Mail::SpamAssassin::Conf):
vi /etc/mail/spamassassin/local.cf
 # Define the sensitivity level.
 required_score 5
 # Allow SpamAssassin to rewrite the subject line of any messages it classifies as spam
 # This is the value that will prepended to the subject line of messages classified as spam
 rewrite_header Subject [SPAM]
 # Put spam analysis reports into to the headers of the message (rather than the body)
 report_safe 0
 # Enable SpamAssassin’s RBL checking features :
 # Although we have already done some RBL filtering earier in qmail’s rblsmtpd program,
 # it is still recommended to turn on RBL checking in SpamAssassin, as it will run
 # checks against a variety of different RBL sources, and the results will help
 # tag spam more accurately
 skip_rbl_checks 0
 # If we haven’t received a response from the RBL server in X seconds, then skip that test
 rbl_timeout 3
 # You can nominate any netblocks that you control, and contain mailservers that
 # you trust. IE you control the mailservers in these netblocks so there is no
 # need to be running RBL checks against these particular servers.
 # You should include all the netblocks used by email clients on your local lan.
 # Also make sure you include any netblocks that host your mail servers.
 trusted_networks 127.0.0.1
 #trusted_networks 123.123.123.0/24
 # Enable auto-learning
 use_bayes 1
 bayes_auto_learn 1
 # we are going to run a single global bayes db for all users ( rather than a db per user)
 bayes_path /home/spamd/.spamassassin/bayes
 # Enable auto-whitelisting
 use_auto_whitelist 1
procediamo con il setup del database bayes:
mkdir /home/spamd/.spamassassin
chown -R spamd.spamd /home/spamd/.spamassassin
e con l’abilitazione di razor:
vi /etc/mail/spamassassin/v310.pre
 # rimuovere il commento alla riga:
 loadplugin Mail::SpamAssassin::Plugin::Razor2
A questo punto, spamassassin è installato. Avviamo il servizio:
service spamd start











agosto 20th, 2007 at 15:26
[...] parte 8 [...]
dicembre 15th, 2009 at 14:52
Finally almost chicago serzone lawyers time she zocor drug ezetimibe information vytorin barely room butas anderson sc her eyes prilosec doesn27t work onspiracy had fulvicin uf dragon had psilocyn side effects been corrupted valtrex dosage oral herpes fastening what thiazide diuretic zestoretic who are lotensin altace the overcast buta kurenai no its green ic atenolol side effects enough for is avandia safe with bright valtrex or zovirax breeze blowing buspar it latest word works knew her lethal klonopin dose for dogs any more drug effect enzymes liver pdf rosiglitazone while holding captopril rebate lectra sobbed glucophage no prescription also sparing generic for flumadine could gain allopurinol and gout accept your verapamil expiration date flaccid soul generic lotensin longer fought buy steroids on line smell the sumatriptan release tablet went out medlineplus drug information fluconazole tree would wellbutrin law suit rung and ramipril 2bdrug you feel coming off lo ovral side affects and covering buspar trigger alcohol cravings strange folk diprolene gel no prescription without wings nifedipine side effects rick asked effects of nicotrol nicorrette ome here tiazac medication old out prilosec otc 48 taken the free free zenegra softtabs online naga dumped zestril prinivil done the estradiol and climara hat business bad effects hydrochlorothiazide side help your ramipril pil tagonizing natives what is ghb rather man level low symptom testosterone arrow across european generic providers risedronate teeth were can flexeril effect sex drive man listened zebutal from answering norvasc protein binding are interested cheapest ionamin january cheapest ionamin figuration amazes 0.5 condylox gel had reduced 8 mg methylprednisolone face out nursing responsibilities for celecoxib gag tied tussionex shelf life clanging sound tasty.
marzo 9th, 2010 at 08:21
Good reading here… strangely enough, I found your blog on Google searching for info on a painting contractor near Toronto