Integrating amavisd-new Into Postfix For Spam- And Virus-Scanning - Page 2
3 Debian SargeFor volatile packages such as ClamAV (there are new ClamAV releases very often), there exists the Debian-volatile repository (for Sarge and Woody only at the time of this writing). To make sure that we install the latest ClamAV package, we edit /etc/apt/sources.list first and add the following line to it: vi /etc/apt/sources.list
Afterwards we update our packages database by running: apt-get update Then we install amavisd-new, SpamAssassin, and ClamAV together with a few other programs (mainly programs that amavisd-new needs to unpack archives, because emails can contain archives as attachments): apt-get install amavisd-new spamassassin clamav clamav-daemon zoo unzip unarj bzip2 unzoo libnet-ph-perl libnet-snpp-perl libnet-telnet-perl nomarch lzop You will be asked a few questions: Virus database update method: <-- daemon Afterwards we must configure amavisd-new by editing /etc/amavis/amavisd.conf. This is a very long file with lots of comments. Most default settings are ok, however please make sure that the @bypass_virus_checks_acl and @bypass_spam_checks_acl are commented out because otherwise amavisd-new will not load the anti-spam/-virus code (in my copy the @bypass_spam_checks_acl line was active so I had to comment it out): vi /etc/amavis/amavisd.conf
And then you should take a look at the spam settings and the actions for spam-/virus-mails in the same file. There's no need to change anything if the default settings are ok for you. The file contains many explanations so there's no need to explain the settings here:
Afterwards, run these commands to add the clamav user to the amavis group and to restart amavisd-new and ClamAV: adduser clamav amavis Next we must edit the configuration file of the Freshclam daemon (that's the daemon that regularly and automatically fetches the newest virus signatures from a ClamAV mirror) because it contains a small bug. Open /etc/clamav/freshclam.conf and modify the NotifyClamd line as shown below: vi /etc/clamav/freshclam.conf
Then restart Freshclam (make sure no other Freshclam process (maybe of another ClamAV installation) is running because then our Freshclam will fail to start): /etc/init.d/clamav-freshclam restart Now we have to configure Postfix to pipe incoming email through amavisd-new: postconf -e 'content_filter = amavis:[127.0.0.1]:10024' Afterwards append the following lines to /etc/postfix/master.cf: vi /etc/postfix/master.cf
Then restart Postfix: /etc/init.d/postfix restart Now run netstat -tap and you should see Postfix (master) listening on port 25 (smtp) and 10025, and amavisd-new on port 10024: server1:~# netstat -tap If you like you can now add Razor, Pyzor, and DCC to SpamAssassin to improve its filtering performance. Razor, Pyzor and DCC are spamfilters that use a collaborative filtering network. To install them, run apt-get install razor pyzor dcc-client Now we have to tell SpamAssassin to use these three programs. Edit /etc/spamassassin/local.cf and add the following lines to it: vi /etc/spamassassin/local.cf
Restart amavisd-new afterwards: /etc/init.d/amavis restart That's it already. Now watch your mail log (/var/log/mail.log) to see if amavisd-new is working properly. amavisd-new will log whenever it finds a spam or virus email. When you (re)start amavisd-new it should also log that it loads its spam and virus scanning code (if not, you probably did something wrong). For taking a live look at your mail log, you can use this command: tail -f /var/log/mail.log (Press CTRL + c to leave the log.)
4 Links
|
Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
Red Hat Virtual Experience - a free virtual event. Dec. 9th





print: 
Recent comments
6 hours 34 min ago
12 hours 22 min ago
14 hours 14 min ago
15 hours 59 min ago
19 hours 49 min ago
1 day 1 hour ago
1 day 1 hour ago
1 day 6 hours ago
1 day 11 hours ago
1 day 16 hours ago