diff -uNr qmail-scanner-1.12/README qmail-scanner-1.12.kaz/README --- qmail-scanner-1.12/README 2002-05-06 13:37:46.000000000 +0900 +++ qmail-scanner-1.12.kaz/README 2002-05-11 01:47:07.000000000 +0900 @@ -146,6 +146,7 @@ * InocuLAN Anti-Virus scanner * RAV Antivirus + * CLAM Antivirus * Sophie: Daemon front-end to Sophos Sweep (see FAQ for details) * Trophie: Daemon front-end to Trend iscan diff -uNr qmail-scanner-1.12/README.html qmail-scanner-1.12.kaz/README.html --- qmail-scanner-1.12/README.html 2002-05-06 13:36:31.000000000 +0900 +++ qmail-scanner-1.12.kaz/README.html 2002-05-11 01:46:15.000000000 +0900 @@ -165,6 +165,7 @@
  • InocuLAN Anti-Virus scanner
  • RAV Antivirus
  • +
  • CLAM Antivirus
  • Sophie: Daemon front-end to Sophos Sweep (see FAQ for details)
  • Trophie: Daemon front-end to Trend iscan (see FAQ for details)
  • Spam Assassin Daemon (see FAQ for details)
  • diff -uNr qmail-scanner-1.12/configure qmail-scanner-1.12.kaz/configure --- qmail-scanner-1.12/configure 2002-05-10 06:16:05.000000000 +0900 +++ qmail-scanner-1.12.kaz/configure 2002-05-31 13:20:48.000000000 +0900 @@ -28,7 +28,7 @@ VERSION=`grep '^# Version: ' qmail-scanner-queue.template` VERSION=`echo $VERSION|awk '{print $NF}'` -SUPPORTED_SCANNERS="sweep,sophie,vscan,trophie,uvscan,csav,antivir,kavscanner,AvpLinux,kavdaemon,AvpDaemonClient,fsav,fprot,inocucmd,rav,verbose_spamassassin,fast_spamassassin" +SUPPORTED_SCANNERS="sweep,sophie,vscan,trophie,uvscan,csav,antivir,kavscanner,AvpLinux,kavdaemon,AvpDaemonClient,fsav,fprot,inocucmd,rav,clamav,verbose_spamassassin,fast_spamassassin" PWD=${PWD:-`pwd`} TMPDIR=${TMPDIR:-/tmp} @@ -623,6 +623,16 @@ fi fi fi + if test -x $dir/clamscan + then + if [ "`echo $FIND_SCANNERS|grep ' clamav '`" != "" ]; then + if [ "`$dir/clamscan -w -r --disable-summary $TMP_DIR 2>&1|grep -i test`" != "" ]; then + CLAMAV="${CLAMAV:-$dir/clamscan}" + INSTALLED_SCANNERS="$INSTALLED_SCANNERS +clamav" + fi + fi + fi if [ "`echo $FIND_SCANNERS|grep spamassassin`" != "" ]; then if test -x $dir/spamassassin then @@ -966,6 +976,10 @@ echo "" echo "Content/Virus Scanners installed on your System" echo "" +if [ "$CLAMAV" != "" ]; then + echo "clamav=$CLAMAV" + SCANNER_ARRAY="$SCANNER_ARRAY,\"clamav\"" +fi if [ "$ISCAN" != "" -a "$TROPHIE" = "" ]; then echo "vscan=$ISCAN" @@ -1197,6 +1211,7 @@ s?FSECURE?$FSECURE?g; s?INOCUCMD?$INOCUCMD?g; s?RAVLIN?$RAVLIN?g; +s?CLAMAV?$CLAMAV?g; s?SPAMASSASSIN_BINARY?$SPAMASSASSIN_BINARY?g; s?SPAMC_BINARY?$SPAMC_BINARY?g; s?SPAMC_OPTIONS?$SPAMC_OPTIONS?g; diff -uNr qmail-scanner-1.12/qmail-scanner-queue.template qmail-scanner-1.12.kaz/qmail-scanner-queue.template --- qmail-scanner-1.12/qmail-scanner-queue.template 2002-05-06 13:36:42.000000000 +0900 +++ qmail-scanner-1.12.kaz/qmail-scanner-queue.template 2002-05-13 16:22:04.000000000 +0900 @@ -180,6 +180,7 @@ my $fsecure_binary='FSECURE'; my $inocucmd_binary='INOCUCMD'; my $ravlin_binary='RAVLIN'; +my $clamav_binary='CLAMAV'; my $spamc_binary='SPAMC_BINARY'; my $spamc_options='SPAMC_OPTIONS'; my $spamassassin_binary='SPAMASSASSIN_BINARY'; @@ -924,6 +925,15 @@ } } close(RA); + } elsif ($scanner eq "clamav") { + open(CL,"$clamav_binary -V 2>&1|")||die "failed to call $clamav_binary -V $!"; + while () { + chop; + if (/ClamScan, version ([0-9\.]+)/) { + $SCANINFO .="clamav: $1. "; + } + } + close(CL); } elsif ($scanner eq "csav") { open(CS,"$csav_binary -virno|")||die "failed to call $csav_binary -virno - $!"; while () { diff -uNr qmail-scanner-1.12/sub-clamav.pl qmail-scanner-1.12.kaz/sub-clamav.pl --- qmail-scanner-1.12/sub-clamav.pl 1970-01-01 09:00:00.000000000 +0900 +++ qmail-scanner-1.12.kaz/sub-clamav.pl 2002-05-13 15:47:17.000000000 +0900 @@ -0,0 +1,27 @@ +sub clamav { + #CLAM ANTIVIRUS + &debug("clamav_scanner: starting scan of directory \"$scandir/$file_id\"..."); + my ($clamav_verbose)="" if (!$DEBUG); + my ($start_clamav_time)=[gettimeofday]; + my ($DD,$clamav_status,$stop_clamav_time,$clamav_time); + my $clamav_options = "-w -r --disable-summary"; + my ($cmd); + $cmd="$clamav_binary $clamav_verbose $clamav_options $scandir/$file_id 2>&1"; + &debug("clamav_scanner: $cmd"); + $DD =`$cmd`; + + &debug("clamav_scanner: $DD"); + + if ($DD =~ /: (.*) FOUND/) { + $quarantine_description=$1; + &debug("There be a virus! ($quarantine_description)"); + ($quarantine_event=$quarantine_description)=~s/\s/_/g; + $quarantine_event="CLAMAV:".substr($quarantine_event,0,$QE_LEN); + $description .= "\n--- clamav results ---\n$DD"; + } + + $stop_clamav_time=[gettimeofday]; + $clamav_time = tv_interval ($start_clamav_time, $stop_clamav_time); + &debug("clamav_scanner: finished scan of dir \"$scandir/$file_id\" in $clamav_time +secs"); +}