--- SA.pm	Thu Sep 20 16:20:54 2007
+++ SA.pm	Thu Sep 20 16:34:08 2007
@@ -360,9 +360,12 @@
   return (0,0,"",0,"") unless $SpamAssassinInstalled;
 
   my($dfhandle);
-  my($dfilename, $dfile, @WholeMessage, $SAResult, $SAHitList);
+  my($dfilename, $dfile, @WholeMessage, $SAResult, $SAHitList, $SAReqHits, $HighScoreVal);
   my($HighScoring, $SAScore, $maxsize, $SAReport, $GSHits);
   my $GotFromCache = undef; # Did the result come from the cache?
+  $SAReqHits = MailScanner::Config::Value('reqspamassassinscore',$message)+0.0;
+  $HighScoreVal = MailScanner::Config::Value('highspamassassinscore',$message);
+
   $GSHits = $message->{gshits} || 0.0;
 
   # Bail out and fake a miss if too many consecutive SA checks failed
@@ -554,6 +557,17 @@
       # Log the fact we got it from the cache. Must not add the "cached"
       # word on the front here or it will be put into the cache itself!
       $GotFromCache = 1;
+
+	  # Need to make sure that any differences in scores are being utilized
+	  if ($SAScore >= $SAReqHits) {
+		  $SAResult = 1;
+		  $SAHitList =~ s/required ([\d\.]+)\,/required $SAReqHits\,/;
+		  if (!$HighScoring && ($SAScore >= $HighScoreVal)) { $HighScoring = 1; }
+	  } elsif ($SAScore < $SAReqHits) {
+		  $SAResult = 0;
+		  $SAHitList =~ s/required ([\d\.]+)\,/required $SAReqHits\,/;
+		  if ($HighScoring && ($SAScore < $HighScoreVal)) { $HighScoring = 0; }
+	  }
 
       #print STDERR "Cache results are $SAResult, $HighScoring, $SAHitList, $SAScore, $SAReport\n";
       # Unlock and close the lockfile
