Bug 5182

Summary: RFE: sa-learn -u should support the non-SQL case, too
Product: Spamassassin Reporter: Richard van der Hoff <bugzilla>
Component: LearnerAssignee: SpamAssassin Developer Mailing List <dev>
Status: NEW ---    
Severity: enhancement    
Priority: P5    
Version: 3.1.7   
Target Milestone: Future   
Hardware: Other   
OS: other   
Whiteboard:

Description Richard van der Hoff 2006-11-13 01:06:00 UTC
Using the default, file-based bayesian databases (this problem doesn't seem to
occur using sql-based bayes), sa-learn -u uses the invoking user's database files.

For example:

# sa-learn -D -u rav --spam 16.
...
[5289] dbg: bayes: tie-ing to DB file R/O /root/.spamassassin/bayes_toks
Comment 1 Theo Van Dinter 2006-11-13 06:51:17 UTC
-u is only useful in terms of SQL.  For DBM mode, you need to either change
bayes_path or set your environment's $HOME variable to a different path.  The
sa-learn docs aren't really clear on that though.

Sending to 3.1.8 queue for doc update.
Comment 2 Richard van der Hoff 2006-11-13 08:31:54 UTC
would it not be possible for -u to do this, though? Seems a lot of hassle to go
twiddling variables for what must be a relatively common use case.
Comment 3 Theo Van Dinter 2006-12-08 11:42:38 UTC
(In reply to comment #2)
> would it not be possible for -u to do this, though? Seems a lot of hassle to go
> twiddling variables for what must be a relatively common use case.

arguably if sa-learn is being run as root, -u could cause changes to $HOME to
point at user's DBs, but then you could just --dbpath which already exists.
Comment 4 Richard van der Hoff 2006-12-08 14:09:43 UTC
I'd have several problems with relying on --dbpath:

1. -u is still there, taunting and confusing me.

2. the user of sa-learn is forced to do the work of understanding which database
engine the local spamassassin has been configured for before he can use it.

3. if bayes_path is changed in the local configuration, this must again be
repeated in --dbpath, where it should be automatically picked up with a -u.

I have to say that I don't actually use sa-learn much, so it's hardly a blocker
for me. I do think the current behaviour is very unintuitive though.
Comment 5 Theo Van Dinter 2007-07-08 00:31:45 UTC
Ok, I've added some documentation to sa-learn to make it clear that -u only
works for SQL.

I'm going to move this ticket to the future milestone queue where at some point
we can look at making -u/non-sql attempt to determine a user's location, similar
to --dbpath.

3.1:
Sending        sa-learn.raw
Transmitting file data .
Committed revision 554332.

3.2:
Sending        sa-learn.raw
Transmitting file data .
Committed revision 554333.

trunk:
Sending        sa-learn.raw
Transmitting file data .
Committed revision 554334.