Discussion:
Different Configuration File
Norman Zhang
2005-03-15 19:02:17 UTC
Permalink
May I ask what's the difference between
/var/lib/amavisd/.spamassassin/user_prefs and
/etc/mail/spamassassin/local.cf?

user_prefs contains

bayes_file_mode 0640
use_bayes 1
auto_learn 1
skip_rbl_checks 1
use_razor2 0
use_pyzor 0
use_dcc 0
#dcc_add_header 1

while local.cf contains

skip_rbl_checks 0
bayes_path /var/lib/amavis/var/.spamassassin/bayes
use_bayes 1
use_razor2 1
use_dcc 1
use_pyzor 0

Regards,
Norman Zhang
Matt Kettler
2005-03-15 19:17:55 UTC
Permalink
Post by Norman Zhang
May I ask what's the difference between
/var/lib/amavisd/.spamassassin/user_prefs and
/etc/mail/spamassassin/local.cf?
In general user_prefs is *intended* for per-user configuration, so that
individual users can over-ride the site-wide defaults.

local.cf (actually any .cf file in /etc/mail/spamassassin) is intended
for site-wide customizations, and gets used for all users. It is
intended to over-ride the default settings SA shipped with.

In your case, amavis always runs as one user, so the user_prefs is only
useful to dictate different behavior between when amavis calls SA, and
when you call SA manually on the command line for testing.

It's a little troubling that you have a bayes_path in local.cf, but your
bayes_file_mode statement is in user_prefs. You really should move that.
If you have bayes_path in local.cf, you should have bayes_file_mode 777
in there, and no mode setting in user_prefs.

(if you make it a site-wide bayes_Path setting, all users must be able
to read, write, and create sub-dirs, or you're going to have problems
when someone other than the amavis user executes sa-learn)
Norman Zhang
2005-03-15 19:48:26 UTC
Permalink
Post by Matt Kettler
In general user_prefs is *intended* for per-user configuration, so that
individual users can over-ride the site-wide defaults.
local.cf (actually any .cf file in /etc/mail/spamassassin) is intended
for site-wide customizations, and gets used for all users. It is
intended to over-ride the default settings SA shipped with.
In your case, amavis always runs as one user, so the user_prefs is only
useful to dictate different behavior between when amavis calls SA, and
when you call SA manually on the command line for testing.
I don't have any user boxes on my gateway. So should I make user_pref
exactly the same as local.cf?
Post by Matt Kettler
It's a little troubling that you have a bayes_path in local.cf, but your
bayes_file_mode statement is in user_prefs. You really should move that.
If you have bayes_path in local.cf, you should have bayes_file_mode 777
in there, and no mode setting in user_prefs.
Done. Thank you.
Post by Matt Kettler
(if you make it a site-wide bayes_Path setting, all users must be able
to read, write, and create sub-dirs, or you're going to have problems
when someone other than the amavis user executes sa-learn)
I have no users on the gateway. It will be amavis killing virus and
SPAM. Do I need at least 1 user?

Regards,
Norman Zhang
Matt Kettler
2005-03-15 20:09:07 UTC
Permalink
Post by Norman Zhang
I don't have any user boxes on my gateway. So should I make user_pref
exactly the same as local.cf?
No, that's a waste. Make user_prefs an empty file and put all the
settings in local.cf
Post by Norman Zhang
I have no users on the gateway. It will be amavis killing virus and
SPAM. Do I need at least 1 user?
Erm. Yes.. you always need at least one user on your system. Can't boot
without root.

It's also a very good idea to have a non-root user to run your mail
systems as. Most mail tools create a user for themselves when they
install. (i.e.: "mail" "amavis", etc).

Most systems also have a generic unprivleged user called "nobody".
Norman Zhang
2005-03-15 20:13:55 UTC
Permalink
Post by Matt Kettler
Post by Norman Zhang
I don't have any user boxes on my gateway. So should I make user_pref
exactly the same as local.cf?
No, that's a waste. Make user_prefs an empty file and put all the
settings in local.cf
Thanks I will merge the setting into local.cf. One thing user_pref
disables DCC and Razor along with autolearn. Should I disable them in
local.cf?
Post by Matt Kettler
Post by Norman Zhang
I have no users on the gateway. It will be amavis killing virus and
SPAM. Do I need at least 1 user?
Erm. Yes.. you always need at least one user on your system. Can't boot
without root.
You are absolutely right.

# ls -l /var/lib/amavis/.spamassassin/user_prefs
-rw-r----- 1 amavis amavis 772 Mar 15 11:38
/var/lib/amavis/.spamassassin/user_prefs

Should I feed SPAM/HAM to postmaster?

Regards,
Norman Zhang
Matt Kettler
2005-03-15 20:29:19 UTC
Permalink
Post by Norman Zhang
Thanks I will merge the setting into local.cf. One thing user_pref
disables DCC and Razor along with autolearn. Should I disable them in
local.cf?
Depends on whether or not you want to use DCC and/or Razor. They are
network checks, so they can be comparatively slow, but they're both very
effective tests. (At least, if you are talking about Razor 2.6 or higher)
Post by Norman Zhang
Should I feed SPAM/HAM to postmaster?
Erm. I'm not quite sure what you mean by this... Is your postmaster
hungry? :)

Seriously though, if you've got a global bayes_path and bayes_file_mode
777 you can do your training when logged in as any user.

However, be wary of trying to train bayes by forwarding mail, that
doesn't work as simply as you might think.
Norman Zhang
2005-03-15 20:34:33 UTC
Permalink
Post by Matt Kettler
Depends on whether or not you want to use DCC and/or Razor. They are
network checks, so they can be comparatively slow, but they're both very
effective tests. (At least, if you are talking about Razor 2.6 or higher)
I would like to use them with SA. They won't affect Bayes scores?
Post by Matt Kettler
Post by Norman Zhang
Should I feed SPAM/HAM to postmaster?
Erm. I'm not quite sure what you mean by this... Is your postmaster
hungry? :)
Maybe my concept is not clear. I don't have local mailbox except
root/postmaster. SA needs to forward SPAM/HAM to some folder from Bayes
training?
Post by Matt Kettler
Seriously though, if you've got a global bayes_path and bayes_file_mode
777 you can do your training when logged in as any user.
Thank you for your recommendation.

Regards,
Norman Zhang

Loading...