--- mimedefang.pl.in.orig Tue Feb 8 17:04:39 2005 +++ mimedefang.pl.in Wed Apr 13 16:22:51 2005 @@ -3714,7 +3714,7 @@ # Run clamscan my($code, $category, $action) = - run_virus_scanner($Features{'Virus:CLAMAV'} . " --mbox --stdout --disable-summary --infected $path 2>&1"); + run_virus_scanner($Features{'Virus:CLAMAV'} . " --unzip --unrar --mbox --stdout --disable-summary --infected $path 2>&1"); if ($action ne 'proceed') { return (wantarray ? ($code, $category, $action) : $code); } @@ -3738,7 +3738,7 @@ # Run clamscan my($code, $category, $action) = - run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --mbox --stdout --disable-summary --infected ./Work 2>&1"); + run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --unrar --mbox --stdout --disable-summary --infected ./Work 2>&1"); if ($action ne 'proceed') { return (wantarray ? ($code, $category, $action) : $code); } @@ -4455,8 +4455,17 @@ $VirusName = $1; return (wantarray ? (1, 'virus', 'quarantine') : 1); } elsif ($output =~ /^(.+) ERROR$/) { - md_syslog('err', "$MsgID: Clamd returned error: $1"); - return (wantarray ? (999, 'swerr', 'tempfail') : 1); + if ($Features{'Virus:CLAMAV'} && $1 =~ /(?:RAR module failure|Input\/Output error|Zip module failure)/) { + my($code, $category, $action) = run_virus_scanner($Features{'Virus:CLAMAV'} . + " --unzip --unrar --mbox --stdout --disable-summary --infected $path 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } + return (wantarray ? interpret_clamav_code($code) : $code); + } else { + md_syslog('err', "$MsgID: Clamd returned error: $1"); + return (wantarray ? (999, 'swerr', 'tempfail') : 1); + } } return (wantarray ? (0, 'ok', 'ok') : 0); } @@ -4539,11 +4548,19 @@ $VirusName = $1; return (wantarray ? (1, 'virus', 'quarantine') : 1); } elsif ($output =~ /^(.+) ERROR$/) { - md_syslog('err', "$MsgID: Clamd returned error: $1"); - return (wantarray ? (999, 'swerr', 'tempfail') : 1); - } - } - else { + if ($Features{'Virus:CLAMAV'} && $1 =~ /(?:RAR module failure|Input\/Output error|Zip module failure)/) { + my($code, $category, $action) = + run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --unrar --mbox --stdout --disable-summary --infected ./Work 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } + return (wantarray ? interpret_clamav_code($code) : $code); + } else { + md_syslog('err', "$MsgID: Clamd returned error: $1"); + return (wantarray ? (999, 'swerr', 'tempfail') : 1); + } + } + } else { # Could not connect to daemon md_syslog('err', "$MsgID: Could not connect to clamd daemon at $clamd_sock"); return (wantarray ? (999, 'cannot-execute', 'tempfail') : 999);