On 8/21/2012 5:51 PM, Ben Johnson wrote:

On 8/21/2012 5:19 PM, John Hardin wrote:
On Tue, 21 Aug 2012, Ben Johnson wrote:

Aug 21 13:08:33.729 [23714] dbg: bayes: tie-ing to DB file R/O
/var/lib/amavis/.spamassassin/bayes_toks

---8<----------
# sa-learn --username=amavis --dump magic
Run that with --debug and verify that the filenames match.

Sure enough, they don't match:

---8<----------
[...]
dbg: bayes: tie-ing to DB file R/O /root/.spamassassin/bayes_toks
dbg: bayes: tie-ing to DB file R/O /root/.spamassassin/bayes_seen
Aug 21 14:41:13.112 [32170] dbg: bayes: found bayes db version 3
0.000          0          3          0  non-token data: bayes db version
0.000          0         95          0  non-token data: nspam
0.000          0        307          0  non-token data: nham
0.000          0      62301          0  non-token data: ntokens
0.000          0 1345469997          0  non-token data: oldest atime
0.000          0 1345579297          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal
sync atime
0.000          0          0          0  non-token data: last expiry atime
0.000          0          0          0  non-token data: last expire
atime delta
0.000          0          0          0  non-token data: last expire
reduction count
---8<----------

So, I suppose that I didn't actually resolve the problem from yesterday,
which was that I cannot seem to train under the "amavis" user due to the
ownership/permissions on the /var/vmail directory.

What good is the --username switch, then?

Why does this command train the "root" user's database?

# sa-learn --username=amavis --spam "/path/to/spam"

And why does this command dump the "root" user's database?

# sa-learn --username=amavis --dump magic

Thanks very much,

As has already been mentioned, the '--username' option is only useful if you're using SQL. You should set your bayes_path so there is no confusion.

Since you have been training the root database, you may want to copy that one over.

$ cp /root/.spamassassin/bayes* /var/lib/amavis/.spamassassin/

Then fix the permissions and ownership back to what they should be for the amavis user.

Then set the bayes path in your local.cf:

bayes_path /var/lib/amavis/.spamassassin/bayes

(Don't double the 'bayes' at the end as was suggested previously unless you want to move the bayes files into a 'bayes' directory)

Restart amavis and try again...

--
Bowie

Reply via email to