You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Randall Perry <rg...@systame.com> on 2004/08/28 23:25:37 UTC

Spamd not reading /etc/mail/spamassassin/local.cf

In the mail.log line below required is set to 5, though I've set it to 10 in
local.cf. I explicitly tell spamd where it's config file is using '-C':
    /usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd -C
/etc/mail/spamassassin/local.cf

And the mail.log still reports 'required=5.0'.

Am I missing something?

Local.cf
--------
required_sccore 10
use_bayes 1
bayes_path /etc/mail/spamassassin/bayes
bayes_auto_learn 1
bayes_auto_learn_threshold_nonspam 0.1
bayes_auto_learn_threshold_spam 12

Mail.log
---------
Aug 28 17:09:44 xserve1 sm-mta[3868]: i7SL9cVl003868: Milter add: header:
X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
version=2.64

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales

http://www.systame.com/



Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Randall Perry <rg...@systame.com>.
>>Good to know. Tried it before I fixed the directives in
>> /etc/mail/spamassassin/local.cf but got no output, which I guess
>> confirms it's not looking there by default for it's config file.
> 
> Not necessarily. However, you haven't tried another of my earlier
> suggestions, yet, which would do a better job of confirming where the
> configuration files are being read from. Use spamassassin -D. Try
> spamassassin -D --lint, for instance. Among other things, I saw
> something like the following on 2.64 on FreeBSD that I installed just
> for you :-)
> 
> debug: using "/usr/local/share/spamassassin" for default rules dir
> debug: using "/usr/local/etc/mail/spamassassin" for site rules dir
> debug: using "/staff/ryan/.spamassassin" for user state dir
> debug: using "/staff/ryan/.spamassassin/user_prefs" for user prefs file
Aha, here's my debug output for file locations (Mac OS 10.3.4):

Aug 30 10:54:01 xserve1 spamd[13769]: debug: using
"/Library/Perl/share/spamassassin" for default rules dir
Aug 30 10:54:01 xserve1 spamd[13769]: debug: using
"/Library/Perl/etc/mail/spamassassin" for site rules dir

So here's the correct command for startup (till I can rebuild with the
correct paths):

/usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd
--siteconfigpath=/etc/mail/spamassassin



-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales

http://www.systame.com/



Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Ryan Thompson <ry...@sasknow.com>.
Randall Perry wrote to Ryan Thompson:

>> Unless you have yet more troubles with your
>> configuration, I believe that's the final solution to your problem.
> It's more than that -- my spamd is definitely not reading
> /etc/mail/spamassasin/local.cf. By using the following command I got some
> output in mail.log:
>
> sudo /usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd
> --siteconfigpath=/etc/mail/spamassassin/local.cf

Randall, please see my original message. --siteconfigpath, like -C,
requires a *directory*, not a filename. This is well documented.

> Got this error:
>
> Aug 29 10:46:53 xserve1 spamd[2840]: Argument "12.00file end
> /etc/mail/spamassassin/local.cf" isn't numeric in addition (+) at
> /Library/Perl/lib/perl5/site_perl/5.8.4/Mail/SpamAssassin/Conf.pm line 1584.
>
> Which tells me that the 'bayes_auto_learn_threshold_spam 12' directive must
> also be v3.0 only.

Actually, that isn't a 3.0-only option. It has existed since
2.50, and exists in 2.64.

> Took the threshold directives out and now it's starting
> properly and is showing correct 'required='.

Good. That's a useful debugging technique.

>> I'm guessing you simply looked up the documentation online, where you
>> stumbled across the SA 3.0 Conf documentation.
>
> Well, I printed the Mail::Spamassassin::Conf doc from search.cpan.org,
> thinking it applied to the version I downloaded.

That'd probably get you the latest development version (3.0). If you
really can not get "perldoc Mail::SpamAssassin::Conf" to work from a
prompt, try http://spamassassin.apache.org/doc.html , and particularly
note the version-specific links near the bottom of the page. In your
case:

http://old.spamassassin.org/full/2.6x/dist/doc/

>> 3. For configuration options that don't seem to work, run
>>   spamassassin --lint, preferably as the same user spamd runs as.
>>   Any errors or warnings reported will hopefully help you fix your
>>   own problem.
>
> Good to know. Tried it before I fixed the directives in
> /etc/mail/spamassassin/local.cf but got no output, which I guess
> confirms it's not looking there by default for it's config file.

Not necessarily. However, you haven't tried another of my earlier
suggestions, yet, which would do a better job of confirming where the
configuration files are being read from. Use spamassassin -D. Try
spamassassin -D --lint, for instance. Among other things, I saw
something like the following on 2.64 on FreeBSD that I installed just
for you :-)

debug: using "/usr/local/share/spamassassin" for default rules dir
debug: using "/usr/local/etc/mail/spamassassin" for site rules dir
debug: using "/staff/ryan/.spamassassin" for user state dir
debug: using "/staff/ryan/.spamassassin/user_prefs" for user prefs file

Using the local.cf file you posted (after substituting required_hits for
required_score), --lint didn't report any errors, and -D --lint didn't
report anything that looked odd to me, *and* every directive worked as
documented in successive tests. There must be something smelly in your
overall configuration.

Again... unless you really know what you're doing, run spamassassin as
the same user spamd will run as, otherwise you don't know if there are
possibly user rules which conflict with site rules, or permissions on
things like the bayes database that aren't set properly. (In your case,
I believe this user was actually called `spamd'). `su root', then `su
spamd' should do the trick.

> How do I call --lint on a specific config file?

You can't. At least, not really. --lint is designed to lint the entire
ruleset.

- Ryan

-- 
   Ryan Thompson <ry...@sasknow.com>

   SaskNow Technologies - http://www.sasknow.com
   901-1st Avenue North - Saskatoon, SK - S7K 1Y4

         Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
   Toll-Free: 877-727-5669     (877-SASKNOW)     North America

Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Randall Perry <rg...@systame.com>.
on 8/29/04 12:44 AM, Ryan Thompson at ryan@sasknow.com wrote:
> Aha. From your original post:
> 
>> Mail.log
>> ---------
>> Aug 28 17:09:44 xserve1 sm-mta[3868]: i7SL9cVl003868: Milter add:
>> header: X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
>> version=2.64
>          ^^^^
> 
> I almost missed this, because it was hiding in a log line near the end
> of your email. That, and I've been up since 5am thanks to a funeral 3
> hours away this morning. Euagh.
> 
> Anyway, "required_score" is a version 3.00 directive. 2.6x still needs
> "required_hits".
Ok, now we're getting somewhere :-)

> Unless you have yet more troubles with your
> configuration, I believe that's the final solution to your problem.
It's more than that -- my spamd is definitely not reading
/etc/mail/spamassasin/local.cf. By using the following command I got some
output in mail.log:

sudo /usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd
--siteconfigpath=/etc/mail/spamassassin/local.cf

Got this error:

Aug 29 10:46:53 xserve1 spamd[2840]: Argument "12.00file end
/etc/mail/spamassassin/local.cf" isn't numeric in addition (+) at
/Library/Perl/lib/perl5/site_perl/5.8.4/Mail/SpamAssassin/Conf.pm line 1584.

Which tells me that the 'bayes_auto_learn_threshold_spam 12' directive must
also be v3.0 only. Took the threshold directives out and now it's starting
properly and is showing correct 'required='.

>  I'm guessing you
>   simply looked up the documentation online, where you stumbled across
>   the SA 3.0 Conf documentation.
Well, I printed the Mail::Spamassassin::Conf doc from search.cpan.org,
thinking it applied to the version I downloaded.

> 3. For configuration options that don't seem to work, run
>   spamassassin --lint, preferably as the same user spamd runs as.
>   Any errors or warnings reported will hopefully help you fix your
>   own problem.

Good to know. Tried it before I fixed the directives in
/etc/mail/spamassassin/local.cf but got no output, which I guess confirms
it's not looking there by default for it's config file.

How do I call --lint on a specific config file?


> Hope this helps,
> - Ryan
Very much, thanks.


-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales

http://www.systame.com/



Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Ryan Thompson <ry...@sasknow.com>.
Randall Perry wrote to Ryan Thompson:

> But, after fixing the typo and restarting spamd still get 'required=5'. And
> after restarting spamd with the following:
> /usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd -C
> /etc/mail/spamassassin

Remember, don't use -C for this!

> I still get 'required=5'.

Aha. From your original post:

> Mail.log
> ---------
> Aug 28 17:09:44 xserve1 sm-mta[3868]: i7SL9cVl003868: Milter add:
> header: X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
> version=2.64
           ^^^^

I almost missed this, because it was hiding in a log line near the end
of your email. That, and I've been up since 5am thanks to a funeral 3
hours away this morning. Euagh.

Anyway, "required_score" is a version 3.00 directive. 2.6x still needs
"required_hits". Unless you have yet more troubles with your
configuration, I believe that's the final solution to your problem.

However, for future questions, might I make a few simple suggestions to
help us help you more efficiently:

1. Always make a relatively obvious point of the version number of SA
    you're using. You included your version, but I missed it initially.
2. Always check the documentation you have on *your* system for
    configuration options. You can almost always do this by running
    "perldoc Mail::SpamAssassin::Conf" at a prompt. I'm guessing you
    simply looked up the documentation online, where you stumbled across
    the SA 3.0 Conf documentation.
3. For configuration options that don't seem to work, run
    spamassassin --lint, preferably as the same user spamd runs as.
    Any errors or warnings reported will hopefully help you fix your
    own problem. At the very least, if you're stumped, posting your
    lint output will greatly help *us* figure out what's going on.
4. Not necessary in this case, but I can't stress it enough for many of
    the questions that get asked here: Use the -D (debug) switch in
    spamassassin when you're trying to track down something that isn't
    working that you've determined (with 3) isn't a simple configuration
    error.

Oh, and, of course, read the Wiki! I'm pretty sure all of this is
discussed there.

Hope this helps,
- Ryan

-- 
   Ryan Thompson <ry...@sasknow.com>

   SaskNow Technologies - http://www.sasknow.com
   901-1st Avenue North - Saskatoon, SK - S7K 1Y4

         Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
   Toll-Free: 877-727-5669     (877-SASKNOW)     North America

Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Randall Perry <rg...@systame.com>.
on 8/28/04 7:23 PM, Ryan Thompson at ryan@sasknow.com wrote:
> Hi Randall,
> 
> You have:
>>    /usr/local/bin/spamd ... -C /etc/mail/spamassassin/local.cf
> 
> perldoc spamd:
>       -C path, --configpath=path
>           Use the specified path for locating the distributed configuration
>           files.  Ignore the default directories (usually
>           /usr/share/spamassassin or similar).
> 

> 
> If you are indeed using /etc/mail/spamassassin, you likely don't need to
> specify --siteconfigpath, unless you're using someone's nonstandard
> package.
> 
I assumed it should be looking in /etc/mail/spamassassin, I used the -C
switch because it didn't seem to be reading the config file. But you're
right -- I was using it incorrectly.


> But, the definite show-stopper:
> 
>> Local.cf
>> --------
>> required_sccore 10
> 
> Typo. Should be `required_score'.
> 
Ooops! Right...thanks.

But, after fixing the typo and restarting spamd still get 'required=5'. And
after restarting spamd with the following:
/usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd -C
/etc/mail/spamassassin

I still get 'required=5'.

Also, I'm starting spamass-milter with:
/usr/local/sbin/spamass-milter -p /var/spamassassin/spamass.sock -f -r 10

Here's my corrected local.cf:

[xserve1:~] randy% cat /etc/mail/spamassassin/local.cf
# This is the right place to customize your installation of SpamAssassin.
# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
# tweaked.
#
###########################################################################
#
#rewrite_subject 0
#report_safe 1
required_score 10
use_bayes 1
bayes_path /etc/mail/spamassassin/bayes
bayes_auto_learn 1
bayes_auto_learn_threshold_nonspam 0.1
bayes_auto_learn_threshold_spam 12



>> use_bayes 1
>> bayes_path /etc/mail/spamassassin/bayes
>> bayes_auto_learn 1
>> bayes_auto_learn_threshold_nonspam 0.1
>> bayes_auto_learn_threshold_spam 12
>> 
>> Mail.log
>> ---------
>> Aug 28 17:09:44 xserve1 sm-mta[3868]: i7SL9cVl003868: Milter add: header:
>> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
>> version=2.64

-- 
Randall Perry
sysTame

Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales

http://www.systame.com/



Re: Spamd not reading /etc/mail/spamassassin/local.cf

Posted by Ryan Thompson <ry...@sasknow.com>.
Randall Perry wrote to spamassassin-users@incubator.apache.org:

> In the mail.log line below required is set to 5, though I've set it to 10 in
> local.cf. I explicitly tell spamd where it's config file is using '-C':
>    /usr/local/bin/spamd -d --pidfile /var/run/spamd.pid -u spamd -C
> /etc/mail/spamassassin/local.cf
>
> And the mail.log still reports 'required=5.0'.
>
> Am I missing something?

Hi Randall,

You have:
>    /usr/local/bin/spamd ... -C /etc/mail/spamassassin/local.cf

perldoc spamd:
        -C path, --configpath=path
            Use the specified path for locating the distributed configuration
            files.  Ignore the default directories (usually
            /usr/share/spamassassin or similar).

Since -C expects a directory name, not a filename, just remove the
"local.cf" from the end of your config path. SpamAssassin is designed to
read any .cf files from the configpath. And, you probably want to use
--siteconfigpath instead:

        --siteconfigpath=path
            Use the specified path for locating site-specific configuration
            files.  Ignore the default directories (usually
            /etc/mail/spamassassin or similar).

If you are indeed using /etc/mail/spamassassin, you likely don't need to
specify --siteconfigpath, unless you're using someone's nonstandard
package.

But, the definite show-stopper:

> Local.cf
> --------
> required_sccore 10

Typo. Should be `required_score'.

> use_bayes 1
> bayes_path /etc/mail/spamassassin/bayes
> bayes_auto_learn 1
> bayes_auto_learn_threshold_nonspam 0.1
> bayes_auto_learn_threshold_spam 12
>
> Mail.log
> ---------
> Aug 28 17:09:44 xserve1 sm-mta[3868]: i7SL9cVl003868: Milter add: header:
> X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no
> version=2.64

-- 
   Ryan Thompson <ry...@sasknow.com>

   SaskNow Technologies - http://www.sasknow.com
   901-1st Avenue North - Saskatoon, SK - S7K 1Y4

         Tel: 306-664-3600   Fax: 306-244-7037   Saskatoon
   Toll-Free: 877-727-5669     (877-SASKNOW)     North America