aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mailscanner/files/patch-lib:MailScanner:SweepViruses.pm
blob: c0b9af5a6f7921f5c07e8b7d2731eb81c5463fff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- ../MailScanner-install-4.34.8.orig/lib/MailScanner/SweepViruses.pm  Fri Oct 22 10:23:15 2004
+++ lib/MailScanner/SweepViruses.pm Fri Oct 22 10:23:34 2004
@@ -2,7 +2,7 @@
 #   MailScanner - SMTP E-Mail Virus Scanner
 #   Copyright (C) 2002  Julian Field
 #
-#   $Id: SweepViruses.pm,v 1.49.2.85 2004/09/28 20:18:51 jkf Exp $
+#   $Id: SweepViruses.pm,v 1.49.2.87 2004/10/21 19:40:25 jkf Exp $
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@
 use vars qw($VERSION $ScannerPID);
 
 ### The package version, both in 1.23 style *and* usable by MakeMaker:
-$VERSION = substr q$Revision: 1.49.2.85 $, 10;
+$VERSION = substr q$Revision: 1.49.2.87 $, 10;
 
 # Locking definitions for flock() which is used to lock the Lock file
 my($LOCK_SH) = 1;
@@ -426,6 +426,12 @@
   MailScanner::Log::DieLog("ClamAV Perl module not found, did you install it?")
     unless eval 'require Mail::ClamAV';
 
+  my $ver = $Mail::ClamAV::VERSION + 0.0;
+  MailScanner::Log::DieLog("ClamAV Perl module must be at least version 0.12" .
+                           " and you only have version %.2f, and ClamAV must" .
+                           " be at least version 0.80", $ver)
+    unless $ver >= 0.12;
+
   $Clam = new Mail::ClamAV(Mail::ClamAV::retdbdir())
     or MailScanner::Log::DieLog("ClamAV Module ERROR:: Could not load " .
        "databases from %s", Mail::ClamAV::retdbdir());
@@ -984,11 +990,17 @@
     while($filename = $child->read()) {
       next unless -f "$dirname/$childname/$filename"; # Only check files
       # JKF Patch suggested by Rick Cooper to support unrar and OLE2 files
-      #$results = $Clam->scan("$dirname/$childname/$filename", Mail::ClamAV::CL_ARCHIVE());
+      #$results = $Clam->scan("$dirname/$childname/$filename",
+      #                       Mail::ClamAV::CL_SCAN_ARCHIVE());
       if (MailScanner::Config::Value('allowpasszips')) { # || $haverar) {
-        $results = $Clam->scan("$dirname/$childname/$filename", Mail::ClamAV::CL_ARCHIVE() | Mail::ClamAV::CL_OLE2());
+        $results = $Clam->scan("$dirname/$childname/$filename",
+                               Mail::ClamAV::CL_SCAN_ARCHIVE() |
+                               Mail::ClamAV::CL_SCAN_OLE2());
       } else {
-        $results = $Clam->scan("$dirname/$childname/$filename", Mail::ClamAV::CL_ARCHIVE() | Mail::ClamAV::CL_ENCRYPTED() | Mail::ClamAV::CL_OLE2());
+        $results = $Clam->scan("$dirname/$childname/$filename",
+                               Mail::ClamAV::CL_SCAN_ARCHIVE() |
+                               Mail::ClamAV::CL_SCAN_BLOCKENCRYPTED() |
+                               Mail::ClamAV::CL_SCAN_OLE2());
       }
 
       unless ($results) {