Mailing List Archive

Correct KAM.cf location?
As I said in a previous post, I'm installing clean.  I'm looking for a
way to validate the installation and make sure that everything with SA
is working as it should.  I'm pretty confident I've got the basic SA
function working.  But along with the bayes issue from a couple of posts
back, I can't seem to make the KAM.cf file get involved.  In previous
installations, I would see a lot of KAM rules showing up in the spam
reports on emails.  I also have written some rules on my own and put
them in a similar file next to KAM.cf in /usr/share/spamassassin.  But
I'm not seeing any of my rules get hit.

I created a rule that triggers if the subject or sender is my company
name.  I sent an email from an outside email address and specifically
added this name to the subject (and it's also in my sender email
address).  Nothing in the spam report.  If I understand things
correctly, that is telling me that my custom .cf file isn't even being
loaded.  So, where is the magic spot to put my custom .cf and the KAM.cf
files so they will get used?
Re: Correct KAM.cf location? [ In reply to ]
On Wed, 2021-10-20 at 11:50 -0500, Jerry Malcolm wrote:
> is working as it should.  I'm pretty confident I've got the basic SA
> function working.  But along with the bayes issue from a couple of posts
> back, I can't seem to make the KAM.cf file get involved.  In previous
> installations, I would see a lot of KAM rules showing up in the spam
> reports on emails.  I also have written some rules on my own and put I'm
> not seeing any of my rules get hit.
>
Have you tried starting spamd with the debugging option 
( -D or --debug ) set?

The output will be quite large, but it will at least show you which
configuration files are being opened and, in the case of any that are
not being opened, where its looking for them.

> I created a rule that triggers if the subject or sender is my company
> name.  I sent an email from an outside email address and specifically
> added this name to the subject (and it's also in my sender email
> address).  Nothing in the spam report.
>
That sounds like the .cf file containing your rule is not being read.
Debugging output should tell you why.

FWIW I found it helpful to have a secondary copy of SA installed on
another system but using the same set of file names etc as the
'production' version. I run that by starting spamd and feeding it test
messages by running something like "spamc <test*.txt" as part of a test
script. This way I could get SA set up as I wanted it and can develop
and test private rules etc. 

Then, because both SA instances have configuration files etc. stored in
an identical set of directories, its easy to properly test new rules and
configuration changes on the development system before copying the file
set to the production system and restarting it to make the changes
active. 

I also all keep all my test messages. This makes it easy to run
regression tests on the development system after any major changes have
been made. 

Another good idea is to keep everything in the development system under
version control. I used to use CVS and now git for this. Of course my
production SA system is backed up as part of regularly scheduled system
backups.

Some of this may sound like unnecessary work, but a fully customised and
tuned SA installation is complex enough to make this approach worthwhile
in the long run, particularly the ability to run regression tests on
your current configuration and rule set.

Martin
Re: Correct KAM.cf location? [ In reply to ]
On 2021-10-20 at 12:50:17 UTC-0400 (Wed, 20 Oct 2021 11:50:17 -0500)
Jerry Malcolm <techstuff@malcolms.com>
is rumored to have said:

> As I said in a previous post, I'm installing clean.  I'm looking for a way to validate the installation and make sure that everything with SA is working as it should.  I'm pretty confident I've got the basic SA function working.  But along with the bayes issue from a couple of posts back, I can't seem to make the KAM.cf file get involved.  In previous installations, I would see a lot of KAM rules showing up in the spam reports on emails.  I also have written some rules on my own and put them in a similar file next to KAM.cf in /usr/share/spamassassin.  But I'm not seeing any of my rules get hit.

Clean that out. Nothing belongs in /usr/share/spamassassin that wasn't installed by the package manager or 'make install' if you built from the distribution yourself.

If you configure the KAM channel as documented at https://mcgrail.com/template/kam.cf_channel you will get its files in the right place.


> I created a rule that triggers if the subject or sender is my company name.  I sent an email from an outside email address and specifically added this name to the subject (and it's also in my sender email address).  Nothing in the spam report.  If I understand things correctly, that is telling me that my custom .cf file isn't even being loaded.  So, where is the magic spot to put my custom .cf and the KAM.cf files so they will get used?

Custom local rules for all users go in /etc/mail/spamassassin/*.cf files.

If you use an outside ruleset that is not available as a sa-update channel, put its *.cf file(s) in /etc/mail/spamassassin/ next to local.cf. *.cf files in /etc/mail/spamassassin/ are loaded in lexical order with later directives overriding earlier ones.



--
Bill Cole
bill@scconsult.com or billcole@apache.org
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Not Currently Available For Hire
Re: Correct KAM.cf location? [ In reply to ]
put your custom rules (including KAM.cf) in /etc/mail/spamassassin and
restart/reload spamd

On 10/20/2021 12:50 PM, Jerry Malcolm wrote:
> As I said in a previous post, I'm installing clean.  I'm looking for a
> way to validate the installation and make sure that everything with SA
> is working as it should.  I'm pretty confident I've got the basic SA
> function working.  But along with the bayes issue from a couple of posts
> back, I can't seem to make the KAM.cf file get involved.  In previous
> installations, I would see a lot of KAM rules showing up in the spam
> reports on emails.  I also have written some rules on my own and put
> them in a similar file next to KAM.cf in /usr/share/spamassassin.  But
> I'm not seeing any of my rules get hit.
>
> I created a rule that triggers if the subject or sender is my company
> name.  I sent an email from an outside email address and specifically
> added this name to the subject (and it's also in my sender email
> address).  Nothing in the spam report.  If I understand things
> correctly, that is telling me that my custom .cf file isn't even being
> loaded.  So, where is the magic spot to put my custom .cf and the KAM.cf
> files so they will get used?
>

--
Rick Cooper
I.T. Manager - Bob Thomas Dealerships
Cell 260-414-8566
Fax 260-434-4400
Email rcooper@dwford.com
Re: Correct KAM.cf location? [ In reply to ]
Bill,

Wow.  Thank you so much for the info.  I'll start digesting all of this
and make sure I have everything set up per the instructions.

BTW.. the 'it' I referred to is the headers info in
"/usr/share/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.
#
# Only a small subset of options are listed below
#
=========================

-- and "/etc/mail/spamassassin/local.cf":

# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)

# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.

==========================

As someone who did decades of teething on Windows and is very late to
the party with linux, I really appreciate your additional clarification
of /usr being static, etc.  But not knowing that.... the local.cf header
is a bit misleading.

Again, thank you so much for the detailed explanations.

Jerry


On 10/20/2021 1:39 PM, Bill Cole wrote:
> On 2021-10-20 at 12:50:17 UTC-0400 (Wed, 20 Oct 2021 11:50:17 -0500)
> Jerry Malcolm <techstuff@malcolms.com>
> is rumored to have said:
>
>> As I said in a previous post, I'm installing clean.  I'm looking for a way to validate the installation and make sure that everything with SA is working as it should.  I'm pretty confident I've got the basic SA function working.  But along with the bayes issue from a couple of posts back, I can't seem to make the KAM.cf file get involved.  In previous installations, I would see a lot of KAM rules showing up in the spam reports on emails.  I also have written some rules on my own and put them in a similar file next to KAM.cf in /usr/share/spamassassin.  But I'm not seeing any of my rules get hit.
> Clean that out. Nothing belongs in /usr/share/spamassassin that wasn't installed by the package manager or 'make install' if you built from the distribution yourself.
>
> If you configure the KAM channel as documented at https://mcgrail.com/template/kam.cf_channel you will get its files in the right place.
>
>
>> I created a rule that triggers if the subject or sender is my company name.  I sent an email from an outside email address and specifically added this name to the subject (and it's also in my sender email address).  Nothing in the spam report.  If I understand things correctly, that is telling me that my custom .cf file isn't even being loaded.  So, where is the magic spot to put my custom .cf and the KAM.cf files so they will get used?
> Custom local rules for all users go in /etc/mail/spamassassin/*.cf files.
>
> If you use an outside ruleset that is not available as a sa-update channel, put its *.cf file(s) in /etc/mail/spamassassin/ next to local.cf. *.cf files in /etc/mail/spamassassin/ are loaded in lexical order with later directives overriding earlier ones.
>
>
>
Re: Correct KAM.cf location? [ In reply to ]
On 2021-10-20 18:50, Jerry Malcolm wrote:
> As I said in a previous post, I'm installing clean. 

https://mcgrail.com/template/kam.cf_channel

no need to make mistakes if its dokumented not to need it :)
Re: Correct KAM.cf location? [ In reply to ]
On 2021-10-20 21:00, Rick Cooper wrote:
> put your custom rules (including KAM.cf) in /etc/mail/spamassassin and
> restart/reload spamd

thats the manuel way of make non clean setup