With spamassassin, is it possible to have the filter show counts of number of messages sent to spam, number of messages sent to ham, and total number of messages processed that a user can check?On Mon, 28 Dec 2015, Bill Cole wrote:

Date: Mon, 28 Dec 2015 23:42:03
From: Bill Cole <sausers-20150...@billmail.scconsult.com>
Reply-To: users@spamassassin.apache.org
To: users@spamassassin.apache.org
Subject: Re: Is BAYES filtering working? Having doubts.

On 28 Dec 2015, at 17:54, Peter L. Berghold wrote:

The script that I use to pull the messages out of a
spam bucket invoking sa-learn runs as root which has permissions to read
from anywhere.  The complication is the amavis does not have permissions
to read the Maildir files for trivial users like root does.

That said, I have some thoughts as how to solve that.

In case your ideas don't work out...

Useful facts: sa-learn reads stdin if you don't give it any file arguments and it can take mbox format as input.

Using these facts, my learning script that runs as root and reads from multiple real users' Maildirs does this to learn ham:

for AFILE in $HAMS ; do formail < $AFILE ; done| sudo -H -u $SAUSER sa-learn --ham --mbox

Where $HAMS is the list of ham message files and $SAUSER is the user handling the system-wide BayesDB. I use formail there just to give each message a leading 'From ' line (i.e. mbox format) so that the whole bunch can be piped into a single sa-learn invocation. The alternative without formail would be to pipe each raw message into its own sa-learn. If you don't have sudo installed or don't like letting root use it, you can replicate the same effect with su in an uglier command line.


--

Reply via email to