Bug 1591 - use_bayes 0 doesn't stop tie()
Summary: use_bayes 0 doesn't stop tie()
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 minor
Target Milestone: 2.50
Assignee: Malte S. Stretz
URL:
Whiteboard:
Keywords: backport
Depends on:
Blocks:
 
Reported: 2003-03-03 08:43 UTC by Matt Sergeant
Modified: 2003-03-16 22:19 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
suggested patch patch None Theo Van Dinter [HasCLA]
new suggested patch, fixes fatal flaw in previous patch patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Sergeant 2003-03-03 08:43:30 UTC
Simple bug - the use_bayes conf item doesn't turn off SpamAssassin's attempts to
tie to the bayes database. The flag is only checked later. A fix would probably
be to check this flag in is_available().

(also note a new Component of "Bayes" in bugzilla wouldn't go amiss)
Comment 1 Theo Van Dinter 2003-03-03 09:00:06 UTC
yes, it should be in is_available as well.  I'll poke around and see what I can find.
Comment 2 Theo Van Dinter 2003-03-03 12:06:37 UTC
Yep, Matt's right on.  I poked around figuing there was probably some other areas that needed a check added, but scan() seemed to be it.  So I added that line and did some other cleanup as well:is_available() got renamed to is_scan_available since it's less of a "is bayes available at all" check and is really just used to determine if we can scan with bayes.due to the above, the top of scan() had a few lines removed which checked (again) whether or not there are enough tokens ...I'll attach the patch shortly.
Comment 3 Theo Van Dinter 2003-03-03 12:08:17 UTC
Created attachment 712 [details]
suggested patch
Comment 4 Theo Van Dinter 2003-03-05 17:47:41 UTC
reassigning to malte
Comment 5 Theo Van Dinter 2003-03-08 05:28:03 UTC
Created attachment 735 [details]
new suggested patch, fixes fatal flaw in previous patch
Comment 6 Theo Van Dinter 2003-03-08 05:31:16 UTC
definitely use the second patch ...  In 2.5x there is no $self->{conf} in 
Bayes, but the is_scan_available code was looking for it so Bayes is always 
disabled.  oops!
Comment 7 Malte S. Stretz 2003-03-15 09:08:43 UTC
I can't okay this patch because I don't know the code. Especially the hunk 
-835,15 +838,6 looks dubious to me: where does that warning go? 
Comment 8 Theo Van Dinter 2003-03-15 15:25:56 UTC
Subject: Re: [SAdev]  use_bayes 0 doesn't stop tie()

On Sat, Mar 15, 2003 at 09:08:43AM -0800, bugzilla-daemon@hughes-family.org wrote:
> I can't okay this patch because I don't know the code. Especially the hunk 
> -835,15 +838,6 looks dubious to me: where does that warning go? 

That's done in is_scan_available() which is added via the patch section
above "-826,8 +828,9".

Comment 9 Malte S. Stretz 2003-03-16 08:59:23 UTC
OKAY, I should have used the source before ;) 
Comment 10 Theo Van Dinter 2003-03-17 07:19:54 UTC
applied to 2.5x branch.  closing ticket. :)