[ start | index | login ]

clamav

Created by kron. Last edited by kron, one year and 350 days ago. Viewed 2,372 times. #2
[diff] [history] [edit] [rdf]
labels
attachments
ClamAV with Procmail

Using procmail is an easy way to use ClamAV with Postfix, or Sendmail (although the Sendmail milter below is probably better for Sendmail users).

SHELL=/bin/sh
DROPPRIVS=yes

AV_REPORT=`clamscan --stdout --disable-summary - | cut -d: -f 2` VIRUS=`if [ "$AV_REPORT" != " OK" ]; then echo Yes; else echo No;fi`

:0fw | formail -i "X-Virus: $VIRUS" :0: * ^X-Virus: Yes $HOME/mail/junkbox

ClamAV with Sendmail Milter

Download the Clam AV RPMs from >>http://dag.wieers.com/packages/clamav/

Install the RPMs

rpm -Uvh clam*

Check Sendmail supports MILTER

sendmail -d0 < /dev/null | grep MILTER MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6

Change clamd to run with a socket

vi /etc/clamd.conf
Uncomment: #LocalSocket /var/run/clamav/clmilter.socket Comment out TCPSocket

Configure Sendmail to use the milter

vi /etc/mail/sendmail.mc
Add: (one line) INPUT_MAIL_FILTER(`clamav', `S=local:/var/run/clamav/clmilter.socket, F=T, T=S:4m;R:4m')

Make sure ClamAV and Sendmail are using the same socket.

vi /etc/sysconfig/clamav-milter
Change the socket location to "/var/run/clamav/clmilter.socket"

Restart all the services

/etc/init.d/clamd start
/etc/init.d/clam-av-milter start
/etc/init.d/sendmail restart

Send a test email and check for the ClamAV headers.

Clam AV and Procmail

Add this to /etc/procmailrc to have the suspicious emails go elsewhere:

:0:
* ^X-Virus-Scan: Suspicious
virus
no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.