Current Cambridge patchset [LONG]

Tony Finch dot at DOTAT.AT
Wed Jul 30 11:34:35 IST 2003


Tony Finch <dot at DOTAT.AT> wrote:
>
>EximDiskStore.pm, PFDiskStore.pm, SMDiskStore.pm, ZMSiskStore.pm,
>SA.pm, Message.pm:
>
>        Instead of not scanning large messages, SpamAssassin scans
>        only the first part of messages up to the Max SpamAssassin Size
>        configuration.

Ooops, I screwed that part up. Revised patch:


--- SMDiskStore.pm      4 Jul 2003 18:08:28 -0000       1.1.1.7
+++ SMDiskStore.pm      30 Jul 2003 10:25:33 -0000      1.15
@@ -285,15 +286,15 @@
 # Passed a ref to the array.
 sub ReadBody {
   my $this = shift;
-  my($body) = @_;
-  my($dh) = $this->{indhandle};
+  my($body,$max) = @_;
+  my $size = 0;
+  my $dh = $this->{indhandle};

   seek($dh, 0, 0); # Rewind the file
-
-  while(<$dh>) {
-    # End of line characters are already there, so don't add them
-    #push @{$body}, $_ . "\n";
-    push @{$body}, $_;
+  my $line;
+  while(defined($line = <$dh>) and $size < $max) {
+    push @{$body}, $line;
+    $size += length $line;
   }
 }



--- EximDiskStore.pm    13 May 2003 17:32:25 -0000      1.1.1.5
+++ EximDiskStore.pm    30 Jul 2003 10:25:33 -0000      1.15
@@ -320,8 +321,8 @@
 # Passed a ref to the array.
 sub ReadBody {
   my $this = shift;
-  my($body) = @_;
-
+  my($body,$max) = @_;
+  my $size = 0;
   my $dh = $this->{indhandle};

   seek($dh, 0, 0); # Rewind the file
@@ -329,10 +330,9 @@
   my $line = <$dh>;
   # FIXME: check that id is correct here

-  while(<$dh>) {
-    # End of line characters are already there, so don't add them
-    #push @{$body}, $_ . "\n";
-    push @{$body}, $_;
+  while(defined($line = <$dh>) and $size < $max) {
+    push @{$body}, $line;
+    $size += length $line;
   }
 }


Tony.
--
f.a.n.finch  <dot at dotat.at>  http://dotat.at/
CROMARTY FORTH TYNE: NORTHERLY 4 OR 5 BECOMING VARIABLE 3 THEN SOUTHERLY 4 OR
5. SHOWERS. MODERATE WITH FOG PATCHES.



More information about the MailScanner mailing list