Debian 8: can't get ClamAV to listen on TCP 3310

Solution 1:

I tried all the other suggestions above and couldn't get it to work.

However, running dpkg-reconfigure clamav-daemon and choosing TCP early on in the configuration options (rather than UNIX) and defaults for everything else worked for me on Ubuntu 16.04.

Solution 2:

simply running

dpkg-reconfigure clamav-daemon

and choosing TCP socket and required port and interface ip (can be any) will get this working properly . You can accept defaults for all other values or specify them.

Solution 3:

I now have it working but it is no where near as nice to configure as it was on Debian 7.

I can only have either TCP or unixsocket (not sure why) but not both running. Hence I am using:

/etc/systemd/system/clamav-daemon.socket.d/extend.conf

[Socket]
ListenStream=
SocketUser=clamav
ListenStream=3310

/etc/clamav/clamd.conf only has:

TCPSocket 3310

and does not have the unix socket information in it. So this is REMOVED:

LocalSocket /var/run/clamav/clamd.ctl
FixStaleSocket true
LocalSocketGroup clamav
LocalSocketMode 666

Then in order to get Exim4 to use it I have:

av_scanner = clamd:127.0.0.1:local

and I couldn't use localhost in there. It had to be 127.0.0.1.

Solution 4:

First purge everything clamav related:

apt-get purge clamav clamav-base clamav-daemon clamav-freshclam clamav-milter clamdscan clamassassin

Then re-install:

apt-get install clamav clamav-base clamav-daemon clamav-freshclam clamav-milter clamdscan clamassassin

Then in /etc/clamav/clamd.conf add

TCPSocket 3310
TCPAddr 127.0.0.1

-above- the existing LocalSocket entry. Else it set things up but times out during execution. Then in /etc/systemd/system/clamav-daemon.socket.d/extend.conf add

ListenStream=127.0.0.1:3310

at the bottom. This will leave the Unix Socket operating as expected and create a listener on port 3310 using "init" as the conduit to the socket. Then re-start the service:

service clamav-daemon restart

and check that init is listening on port 3310:

netstat -anp | grep 3310

Then test out ThunderBird's Add-Ons -> clamdrib -> Preferences -> Test