[CentOS] Clamd and Amavis

Mon Apr 13 12:02:55 UTC 2009
Ned Slider <ned at unixmail.co.uk>

Anne Wilson wrote:
> I'm trying to get amavis  to play using clamd and tried to follow this:
> 
> # ### http://www.clamav.net/
> ['ClamAV-clamd',
>    \&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd"],
>    qr/\bOK$/, qr/\bFOUND$/,
>    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
> # # NOTE: run clamd under the same user as amavisd, or run it under its own
> # #   uid such as clamav, add user clamav to the amavis group, and then add
> # #   AllowSupplementaryGroups to clamd.conf;
> # # NOTE: match socket name (LocalSocket) in clamav.conf to the socket name in
> # #   this entry; when running chrooted one may prefer socket "$MYHOME/clamd".
> 
> # ### http://www.clamav.net/ and CPAN  (memory-hungry! clamd is preferred)
> # # note that Mail::ClamAV requires perl to be build with threading!
> # ['Mail::ClamAV', \&ask_clamav, "*", [0], [1], qr/^INFECTED: (.+)/],
> 
> I came unstuck with the instruction regarding the LocalSocket.  If I change 
> that in clamd.conf to $MYHOME/amavisd.sock or $MYHOME/clamd the clamd service 
> won't start, saying the socket doesn't exist.
> 
> What am I doing wrong?
> 
> Anne

Check the settings match in both /etc/amavisd.conf AND /etc/clamd.conf 
(eg, /var/run/clamav/clamd). IIRC they are different by default so you 
must change one of them.

Also, in /etc/clamd.conf make sure you've commented out TCPSocket if 
you're using a local UNIX socket.

For reference:

http://wiki.centos.org/HowTos/Amavisd