--- /usr/share/perl5/Mail/SpamAssassin/BayesStore.pm	Sat Sep 20 11:05:23 2003
+++ BayesStore.pm	Wed Sep  8 13:46:10 2004
@@ -958,6 +958,7 @@
   my ($self, $ds, $dh, $tok, $atime) = @_;
 
   $atime = 0 unless defined $atime;
+  my $now=time; $atime=$now if ($atime >$now); # az fixme
 
   if ($self->{bayes}->{main}->{learn_to_journal}) {
     $self->defer_update ("c $ds $dh $atime $tok");
@@ -978,6 +979,7 @@
 
 sub tok_touch {
   my ($self, $tok, $atime) = @_;
+  my $now=time; $atime=$now if ($atime >$now); # az fixme
   $self->defer_update ("t $atime $tok");
 }
 
@@ -1194,7 +1196,8 @@
   # If the new atime is < the old atime, ignore the update
   # We figure that we'll never want to lower a token atime, so abort if
   # we try.  (journal out of sync, etc.)
-  return if ( $oldatime >= $atime );
+  my $now=time;
+  return if ( $oldatime >= $atime and $oldatime <= $now ); # az fixme
 
   $self->tok_put ($tok, $ts, $th, $atime);
 }
@@ -1206,7 +1209,8 @@
   $th += $dh; if ($th < 0) { $th = 0; }
 
   # Don't roll the atime of tokens backwards ...
-  $atime = $oldatime if ( $oldatime > $atime );
+  my $now=time;
+  $atime = $oldatime if ( $oldatime > $atime and $oldatime <= $now); # az fixme
 
   $self->tok_put ($tok, $ts, $th, $atime);
 }
@@ -1220,6 +1224,8 @@
     return;
   }
 
+  my $now=time; $atime=$now if ($atime >$now); # az fixme
+
   # use defined() rather than exists(); the latter is not supported
   # by NDBM_File, believe it or not.  Using defined() did not
   # indicate any noticeable speed hit in my testing. (Mar 31 2003 jm)
@@ -1455,6 +1461,9 @@
 sub tok_pack {
   my ($self, $ts, $th, $atime) = @_;
   $ts ||= 0; $th ||= 0; $atime ||= 0;
+
+  my $now=time; $atime=$now if ($atime >$now); # az fixme
+
   if ($ts < 8 && $th < 8) {
     return pack ("CV", ONE_BYTE_FORMAT | ($ts << 3) | $th, $atime);
   } else {

