Reporting spam with Spmassassin-run instead of sa-learn

View: New views
8 Messages — Rating Filter:   Alert me  

Reporting spam with Spmassassin-run instead of sa-learn

by Magnus Anderson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At the moment I run sa-learn for learning new messages as spam/ham. The problem with this is that it just reports to bayes, not razor2, pyzor, dcc or spamcop.

It is stated in the spamassassin-run manual that spamassassin-run is for reporting to these places, and to use sa-learn only if I want to report to bayes locally.

My problem is that I use a DB for user preferences and different bays DBs for every user. This works with sa-learn by specifying "-u <username>", but I can't seem to find this option in the spamassassin command. It defaults as "root" for me.

So basicly, I want to run the "spamassassin --revoke/--report" commands as a specific username. How can I do that?

Re: Reporting spam with Spmassassin-run instead of sa-learn

by Martin Schütte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Magnus Anderson schrieb:
> So basicly, I want to run the "spamassassin --revoke/--report" commands as a
> specific username. How can I do that?

man su

For example: su vscan -c "spamassassin --report ${train_dir_sa_spam}/*"
(Make sure the user has permission to read the mails.)

--
Martin

Re: Reporting spam with Spmassassin-run instead of sa-learn

by Magnus Anderson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Martin Schütte wrote:
Magnus Anderson schrieb:
> So basicly, I want to run the "spamassassin --revoke/--report" commands as a
> specific username. How can I do that?

man su

For example: su vscan -c "spamassassin --report ${train_dir_sa_spam}/*"
(Make sure the user has permission to read the mails.)
The user is not exisiting on the system itself, just inside CommuniGate that I run.
When I run now I run like "sa-learn --spam --no-sync -u username@domain.com /system-path-to-mbox"

Sorry if I wasn't explaining myself correctly.

Re: Reporting spam with Spmassassin-run instead of sa-learn

by Matt Kettler-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Magnus Anderson wrote:

> At the moment I run sa-learn for learning new messages as spam/ham. The
> problem with this is that it just reports to bayes, not razor2, pyzor, dcc
> or spamcop.
>
> It is stated in the spamassassin-run manual that spamassassin-run is for
> reporting to these places, and to use sa-learn only if I want to report to
> bayes locally.
>
> My problem is that I use a DB for user preferences and different bays DBs
> for every user. This works with sa-learn by specifying "-u <username>", but
> I can't seem to find this option in the spamassassin command. It defaults as
> "root" for me.
>
> So basicly, I want to run the "spamassassin --revoke/--report" commands as a
> specific username. How can I do that?
>  
su -c "username" spamassassin --revoke...




Re: Reporting spam with Spmassassin-run instead of sa-learn

by Matt Kettler-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matt Kettler wrote:

> Magnus Anderson wrote:
>  
>> At the moment I run sa-learn for learning new messages as spam/ham. The
>> problem with this is that it just reports to bayes, not razor2, pyzor, dcc
>> or spamcop.
>>
>> It is stated in the spamassassin-run manual that spamassassin-run is for
>> reporting to these places, and to use sa-learn only if I want to report to
>> bayes locally.
>>
>> My problem is that I use a DB for user preferences and different bays DBs
>> for every user. This works with sa-learn by specifying "-u <username>", but
>> I can't seem to find this option in the spamassassin command. It defaults as
>> "root" for me.
>>
>> So basicly, I want to run the "spamassassin --revoke/--report" commands as a
>> specific username. How can I do that?
>>  
>>    
> su -c "username" spamassassin --revoke...
>
>
>  
Erk, that should be su "username" -c "spamassassin --revoke".. Pardon my
error.




Re: Reporting spam with Spmassassin-run instead of sa-learn

by Martin Schütte :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Magnus Anderson schrieb:
> The user is not exisiting on the system itself, just inside CommuniGate that
> I run.
> When I run now I run like "sa-learn --spam --no-sync -u username@...
> /system-path-to-mbox"

AFAIK you cannot tell "spamassassin" to use another bayes DB.

So I see three other options:
- Patch spamassassin and add a new option ;)

- Learn the messages twice: with sa-learn and with spamassassin. That
will leave you with an additional DB in ~root/.spamassassin.

- Use symlinks (ln -s /userdir/with/bayesDb ~root/.spamassassin) to link
the user's DB into root's spamassassin directory.

--
Martin

Re: Reporting spam with Spmassassin-run instead of sa-learn

by bgodette :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Magnus Anderson wrote:

>
>
> Martin Schütte wrote:
>> Magnus Anderson schrieb:
>>> So basicly, I want to run the "spamassassin --revoke/--report" commands
>>> as a
>>> specific username. How can I do that?
>> man su
>>
>> For example: su vscan -c "spamassassin --report ${train_dir_sa_spam}/*"
>> (Make sure the user has permission to read the mails.)
>>
>
> The user is not exisiting on the system itself, just inside CommuniGate that
> I run.
> When I run now I run like "sa-learn --spam --no-sync -u username@...
> /system-path-to-mbox"
>
> Sorry if I wasn't explaining myself correctly.
>

This can be done with the spamd/spamc tell feature. Adding -l to spamd's
command line and -C report/revoke for learning through spamc. A
report/revoke will do the appropriate bayes stuff even tho the man page
isn't clear that it does bayes in addition to the various reporting methods.


Re: Reporting spam with Spmassassin-run instead of sa-learn

by Magnus Anderson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matt Kettler-3 wrote:
Matt Kettler wrote:
> su -c "username" spamassassin --revoke...
>
>
>  
Erk, that should be su "username" -c "spamassassin --revoke".. Pardon my
error.
Please read my reply to Martin Schütte earlier.