Solved

Clamav problems with amavisd, postfix, spamassin

Posted on 2004-10-08
1
425 Views
Last Modified: 2007-12-19
Hello

Im running Redhat 9 with postfix, amavisd, clamav and spamassassin installed.

I keep getting errors in the maillog which are displayed below.

Oct  8 11:07:45 linuxmail amavis[3762]: (03762-06) ClamAV-clamd: Can't connect to UNIX socket /usr/local/sbin/clamd: Connection refused, retrying (2)
Oct  8 11:07:45 linuxmail amavis[3756]: (03756-07) ClamAV-clamd: Can't connect to UNIX socket /usr/local/sbin/clamd: Connection refused, retrying (2)
Oct  8 11:07:51 linuxmail amavis[3762]: (03762-06) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /usr/local/sbin/clamd (Can't connect to UNIX socket /usr/local/sbin/clamd: Connection refused) at (eval 34) line 243.
Oct  8 11:07:51 linuxmail amavis[3762]: (03762-06) WARN: all primary virus scanners failed, considering backups
Oct  8 11:07:51 linuxmail amavis[3756]: (03756-07) ClamAV-clamd av-scanner FAILED: Too many retries to talk to /usr/local/sbin/clamd (Can't connect to UNIX socket /usr/local/sbin/clamd: Connection refused) at (eval 34) line 243.
Oct  8 11:07:51 linuxmail amavis[3756]: (03756-07) WARN: all primary virus scanners failed, considering backups
Oct  8 11:07:52 linuxmail amavis[3762]: (03762-06) TROUBLE in check_mail: virus_scan FAILED: Not an ARRAY reference at (eval 35) line 124.

I have tried everything i can to try and get it working. Ive set the LocalSocket in both the avamisd.conf and clamd.conf and ClamAV is also running with the amavis user account.

Can anyone help? im going mad here and ive exhaulsted google.

Thanks

DAN
0
Comment
Question by:DClayden
1 Comment
 
LVL 3

Accepted Solution

by:
TRobertson earned 250 total points
ID: 12259779
Are you using something like the following?

@av_scanners = (
 #### http://www.clamav.net/
 ['Clam Antivirus-clamd',
   \&ask_daemon, ["CONTSCAN {}\n", '/var/amavisd/clamd.sock'],
   qr/\bOK$/, qr/\bFOUND$/,
   qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
# # NOTE: run clamd under the same user as amavisd,
# # match the socket name in clamav.conf to the socket name in this entry
);

Make sure that you have /var/amavisd/clamd.sock and that the permissions are correct on it.  ls -l /var/amavisd/clamd.sock

And clamav.conf
# Path to the local socket. The daemon doesn't change the mode of the
# created file (portability reasons). You may want to create it in a directory
# which is only accessible for a user running daemon.
LocalSocket /var/amavisd/clamd.sock

Do ps aux | grep clamd to make sure its running and under what username.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now