1 |
On Sun, 06 Mar 2011 02:00:02 +0100, meino.cramer@×××.de wrote about Re: |
2 |
[gentoo-user] spamd and user nobody, sa-learn: |
3 |
|
4 |
>David W Noon <dwnoon@××××××××.com> [11-03-05 15:43]: |
5 |
[snip] |
6 |
>> I need to specify the full path to the executable, /usr/bin/sa-learn, |
7 |
>> when I use sudo to run it as amavis. [Note that I use Spamassassin as |
8 |
>> part of Postfix via the amavisd-new daemon. I also have my Bayes |
9 |
>> tokens in a PostgreSQL database. So my sa-learn command looks rather |
10 |
>> different from yours anyway.] |
11 |
[snip] |
12 |
>no luck...the problem remains the same with or without the full |
13 |
>path... |
14 |
|
15 |
Run visudo (as root) and check your sudo option. The ones on my |
16 |
system, applicable to this, are as follows: |
17 |
|
18 |
Defaults env_reset, always_set_home |
19 |
|
20 |
Cmnd_Alias SPAMASSASSIN |
21 |
= /usr/bin/sa-learn, /usr/bin/spamassassin, /usr/bin/spamc |
22 |
|
23 |
%mail ALL=(amavis) NOPASSWD: SPAMASSASSIN |
24 |
|
25 |
[Note that the second one is on 1 line. My newsreader has word-wrapped |
26 |
it to 2 lines at its first punctuation mark.] |
27 |
|
28 |
This allows anyone in the "mail" group to run any of the end-user |
29 |
commands for Spamassassin as the "amavis" user, without requiring them |
30 |
to supply a password -- or even that "amavis" have a password. |
31 |
|
32 |
I usually export spam or ham into an mbox file and then run: |
33 |
|
34 |
sudo -u amavis /usr/bin/sa-learn --ham --mbox /tmp/good_ham.mbx |
35 |
|
36 |
and this works well. |
37 |
-- |
38 |
Regards, |
39 |
|
40 |
Dave [RLU #314465] |
41 |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |
42 |
dwnoon@××××××××.com (David W Noon) |
43 |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* |