clamav-autoupdate is not reading the PACKAGEDIR variable

Rick Cooper rcooper at
Tue Apr 17 18:39:46 IST 2012

My question is what is the point of using the mailscanner updater when using
clamd? why not just run freshclamd or use a regular cron job? Mailscanner
doesn't need to know when the sigs are updated when using clamd


From: mailscanner-bounces at
[mailto:mailscanner-bounces at] On Behalf Of Brad
Sent: Tuesday, April 17, 2012 12:35 PM
To: mailscanner at
Subject: clamav-autoupdate is not reading the PACKAGEDIR variable

I recently switch from clamav to clamd on MailScanner 4.84.5 and found an
error message in the maillog and I wanted to share the discovery and my fix:
Here is the error in the maillog:
ClamAV-autoupdate[18219]: ClamAV updater /usr/local/bin/freshclam cannot be
First, where is freshclam located.
# which freshclam

Ok, so the third column in the virus.scanner.conf file needs to be just
I checked the virus.scanner.conf
clamav          /usr/lib/MailScanner/clamav-wrapper     /usr
Ok, the third parameter was set correctly.
perform a manual check to see if the clamav-auto-update script was working
and found that it failed
clamav-autoupdate /usr /tmp
ClamAV-autoupdate[19672]: ClamAV updater /usr/local/bin/freshclam cannot be
Check the update_virus_scanners perl script and found that the script is
passing the PACKAGEDIR variable (which is extracted from the
virus.scanners.conf file) to the clamav-autoupdate script.  See line 58.
line 56         # echo Updating $NAME
line 57         logger -p -t update.virus.scanners Running
autoupdate for $NAME
line 58         ${UPDATER} "${PACKAGEDIR}" "${LOCK}" >/dev/null 2>&1
Line 58 executes the clamav-autoupdate scipt in the MailScanner library, so
lets look at that file.
The clamav-autoupdate script shows that the directory hard coded and is not
reading the passed in PACKAGEDIR variable.
$PackageDir = "/usr/local";
I changed the packageDir line so that if a parameter is passed in to use it
otherwise set it to "/usr/local"
$PackageDir = shift || "/usr/local";
clamav-autoupdate /usr /tmp
ClamAV-autoupdate[18880]: ClamAV updated
Perfect and fixes my issue.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the MailScanner mailing list