Re: [Exim] Exiscan with Sophos and Sophie

Pàgina inicial
Delete this message
Reply to this message
Autor: Sheldon Hearn
Data:  
A: Gordon McKee
CC: Tom Kistner, exim-users
Assumpte: Re: [Exim] Exiscan with Sophos and Sophie
On (2003/08/21 16:33), Gordon McKee wrote:

> Many thanks - anyone have a FreeBSD version? I'll give the Linux version a
> try anyway.


I use FreeBSD, and have just dropped sophos in favour of clamd, part of
the clamav distribution, available in the ports tree as
ports/mail/clamav.

Clamd absolutely rocks.

Just an opinion. Use it, don't use it. :-)

If you decide to use it, here are my notes for getting clamd to play
with exim on FreeBSD. The notes assume you're familiar with Exim and
exiscan-acl.

* Install both exim and clamav from the ports tree.

* Add user clamav to the mail group in /etc/group.

* Create /var/log/clamav and /var/run/clamav, and change the ownership
of both to clamav:clamav.

* In Exim's configure file, set av_scanner=clamd:/var/run/clamav/clamd

* Adjust the exiscan ACLs in Exim's configure file. Make sure you use
the demime option with the malware check, e.g.:

   deny message = This message contains malware ($malware_name)
    demime  = *
    malware = *


* Edit clamav.conf as follows:

    LogFile /var/log/clamav/clamd.log
    PidFile /var/run/clamav/clamd.pid
    LocalSocket /var/run/clamav/clamd
    User clamav
    AllowSupplementaryGroups
    ScanArchive


You may wish to make other changes as well.

* Install the shell script included at the end of this email as
/usr/local/etc/rc.d/clamd.sh.

* Run freshclam.

* Add a cron job that runs freshclam --daemon-notify --quiet at least
once a day.

* Start clamd with /usr/local/etc/rc.d/clamd.sh .

* Start Exim with /usr/local/etc/rc.d/exim.sh .

I should probably commit these notes to port.

Ciao,
Sheldon.

#!/bin/sh
#
# $Id: clamd.sh,v 1.1 2003/08/21 15:13:40 sheldonh Exp $
#
# This is ugly. I was in a hurry.
#
PREFIX=/usr/local
CLAMAV_BIN=${PREFIX}/sbin

case $1 in
start)
    [ -x ${CLAMAV_BIN}/clamd ] && {
    ${CLAMAV_BIN}/clamd
    echo -n ' clamd'
    }
    ;;


stop)
    kill `cat /var/run/clamav/clamd.pid`
    if [ $? = 0 ] ; then
        echo -n ' clamd'
    fi
    ;;


restart)
    /usr/local/etc/rc.d/clamd.sh stop && \
        /usr/local/etc/rc.d/clamd.sh start
    ;;


*)
    echo "usage: `basename $0` {start|stop|restart}" >&2
    exit 64
    ;;
esac