--- /usr/lib/MailScanner/MailScanner/SweepViruses.pm	Mon Jan 27 17:10:40 2003
+++ SweepViruses.pm	Wed Feb  5 21:27:38 2003
@@ -627,7 +627,19 @@
   $infected = $line;
   $infected =~ s/^.*found\s*in\s*file\s*//i;
   # Catch the extra stuff on the end of the line as well as the start
-  $infected =~ s/^Could not check\s*(.+) \([^)]+\)$/$1/i;
+  $infected =~ s/^Could not check\s*(.+) \(([^)]+)\)$/$1/i;
+  my $error = $2;
+
+  # If the error is one of the allowed errors, then don't report any
+  # infections on this file.
+  if ($error ne "") {
+    my $errorlist = MailScanner::Config::Value('sophosallowederrors');
+    if ($errorlist && $errorlist =~ /$error/) {
+      MailScanner::Log::WarnLog("Ignored Sophos '%s' error", $error);
+      return 0;
+    }
+  }
+  
   #$infected =~ s/^Could not check\s*//i;
   # JKF 10/08/2000 Used to split into max 3 parts, but this doesn't handle
   # viruses in zip files in attachments. Now pull out first 3 parts instead.