Piping spam to learn

388 views
Skip to first unread message

marc perkel

unread,
Dec 15, 2015, 7:53:13 PM12/15/15
to rspamd
will this work for learning spam messages?

cat message.spam | rspamc learn-spam

There's a reason I need to pipe it.


Alexander Moisseev

unread,
Dec 16, 2015, 12:31:44 AM12/16/15
to rspamd
It will work if you replace dash with underscore in the learn_spam command.

marc perkel

unread,
Dec 16, 2015, 1:07:41 AM12/16/15
to rspamd
ok - did that. I'm getting this:

rspamc learn_ham
Results for file: stdin (0.001 seconds)
HTTP error: 500, cannot open backend for statfile BAYES_HAM

What am I doinf wrong?

Alexander Moisseev

unread,
Dec 16, 2015, 1:18:49 AM12/16/15
to rspamd
Do you have statistics files in locations specified in statistic.conf and rspamd has write permissions?

среда, 16 декабря 2015 г., 9:07:41 UTC+3 пользователь marc perkel написал:

marc perkel

unread,
Dec 16, 2015, 1:27:20 AM12/16/15
to rspamd
actually - i'm doing this:

cat $FILENAME | ssh rspamd0.ctyme.com "cat - | /usr/bin/rspamc learn_ham &> /dev/null"
 

marc perkel

unread,
Dec 16, 2015, 1:30:10 AM12/16/15
to rspamd
I have no idea. Is this it?

drwxr-xr-x  2 _rspamd _rspamd 4096 Dec 15 11:02 .
drwxr-xr-x 16 root    root    4096 Dec 15 11:02 ..
-rw-r--r--  1 _rspamd _rspamd 9216 Dec 15 11:02 bayes.ham.sqlite
-rw-r--r--  1 _rspamd _rspamd 9216 Dec 15 11:02 bayes.spam.sqlite
srw-------  1 root    root       0 Dec 15 11:02 rspamd.sock

Alexander Moisseev

unread,
Dec 16, 2015, 3:49:32 AM12/16/15
to rspamd
Can you post output of
 # rspamadm configdump | grep -A 30 'classifier'

среда, 16 декабря 2015 г., 9:30:10 UTC+3 пользователь marc perkel написал:

marc perkel

unread,
Dec 16, 2015, 12:05:24 PM12/16/15
to rspamd
classifier {
    type = "bayes";
    tokenizer {
        name = "osb";
    }
    cache {
        path = "/var/lib/rspamd/learn_cache.sqlite";
    }
    min_tokens = 11;
    backend = "sqlite3";
    languages_enabled = true;
    statfile {
        symbol = "BAYES_HAM";
        path = "/var/lib/rspamd/bayes.ham.sqlite";
        spam = false;
    }
    statfile {
        symbol = "BAYES_SPAM";
        path = "/var/lib/rspamd/bayes.spam.sqlite";
        spam = true;

Vsevolod Stakhov

unread,
Dec 16, 2015, 12:56:18 PM12/16/15
to marc perkel, rspamd
On 16/12/2015 17:05, marc perkel wrote:
> classifier {
> type = "bayes";
> tokenizer {
> name = "osb";
> }
> cache {
> path = "/var/lib/rspamd/learn_cache.sqlite";
> }
> min_tokens = 11;
> backend = "sqlite3";
> languages_enabled = true;
> statfile {
> symbol = "BAYES_HAM";
> path = "/var/lib/rspamd/bayes.ham.sqlite";
> spam = false;
> }
> statfile {
> symbol = "BAYES_SPAM";
> path = "/var/lib/rspamd/bayes.spam.sqlite";
> spam = true;
> }
> }

Your configuration seems to be OK if your '/var/lib/rspamd/' directory
is available for user `_rspamd` for writing. Among your files, I don't
see learn_cache that might be an issue.

--
Vsevolod Stakhov

marc perkel

unread,
Dec 16, 2015, 1:41:39 PM12/16/15
to rspamd
Thanks for your help BTW.

What do I need to do to make it work? What creates learn_cache? 
Reply all
Reply to author
Forward
0 new messages