|
[SACVS] CVS: spamassassin/lib/Mail/SpamAssassin Bayes.pm,1.95,1.96: msg#00086mail.spam.spamassassin.cvs
Update of /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin In directory sc8-pr-cvs1:/tmp/cvs-serv8338/lib/Mail/SpamAssassin Modified Files: Bayes.pm Log Message: bug 2491: 1) the learn_to_journal option was only good for autolearning and using sa-learn, but "spamassassin -r" just went r/w all the time. 2) when running from spamassassin, caller_will_untie was false. so when learn() called forget(), forget() would untie, thereby leaving learn() screwed. this was generating the undefined warnings since the untie() cleared db_version. so we kluge around that by saving/setting caller_will_untie, then restoring after the forget(). 3) forget() didn't know it could "learn to journal", so it always went r/w. Index: Bayes.pm =================================================================== RCS file: /cvsroot/spamassassin/spamassassin/lib/Mail/SpamAssassin/Bayes.pm,v retrieving revision 1.95 retrieving revision 1.96 diff -b -w -u -d -r1.95 -r1.96 --- Bayes.pm 19 Sep 2003 04:02:40 -0000 1.95 +++ Bayes.pm 23 Sep 2003 00:08:05 -0000 1.96 @@ -660,7 +660,15 @@ warn ("db_seen corrupt: value='$seen' for $msgid. ignored"); } else { dbg ("$msgid: already learnt as opposite, forgetting first"); + + # kluge so that forget() won't untie the db on us ... + my $orig = $self->{main}->{learn_caller_will_untie}; + $self->{main}->{learn_caller_will_untie} = 1; + $self->forget ($msg); + + # reset the value post-forget() ... + $self->{main}->{learn_caller_will_untie} = $orig; } } @@ -707,7 +715,14 @@ eval { local $SIG{'__DIE__'}; # do not run user die() traps in here - if ($self->{store}->tie_db_writable()) { + my $ok; + if ($self->{main}->{learn_to_journal}) { + $ok = $self->{store}->tie_db_readonly(); + } else { + $ok = $self->{store}->tie_db_writable(); + } + + if ($ok) { $ret = $self->forget_trapped ($msg, $body, $id); if (!$self->{main}->{learn_caller_will_untie}) { ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [SACVS] CVS: spamassassin/lib/Mail SpamAssassin.pm,1.211,1.212: 00086, Theo Van Dinter |
|---|---|
| Next by Date: | [SACVS] CVS: spamassassin Changes,1.46,1.47: 00086, Theo Van Dinter |
| Previous by Thread: | [SACVS] CVS: spamassassin/lib/Mail SpamAssassin.pm,1.211,1.212i: 00086, Theo Van Dinter |
| Next by Thread: | [SACVS] CVS: spamassassin Changes,1.46,1.47: 00086, Theo Van Dinter |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |