Spamassassin local.cf ignored

Bugs in eFa 5
Post Reply
sergio_eristoff
Posts: 12
Joined: 27 Nov 2018 06:43

Spamassassin local.cf ignored

Post by sergio_eristoff »

Hello!

I have now successfully installed an EFA5 with Rocky Linux 9. So far it works fine, but I have a problem with Spamassassin. Various scores are too low for my taste, so I have always adjusted them, but this does not work.
I have already copied the old local.cf from my old EFA4 installation, but this is ignored.

Is another configuration file responsible here?

Thank you!
User avatar
activateit
Posts: 8
Joined: 10 Jul 2019 03:17

Re: Spamassassin local.cf ignored

Post by activateit »

I'm finding the same thing. I've got a local-seo.cf that was catching the seo spam under Efa4, yet this file looks like it's not even getting read in by the system.

it's located in the "/etc/mail/spamassassin" dir
User avatar
Aryfir
Posts: 37
Joined: 04 Sep 2020 13:52

Re: Spamassassin local.cf ignored

Post by Aryfir »

Hi,

My local.cf from eFa v4, cek permission first:
1)

Code: Select all

[root@mx spamassassin]# ls -l local.cf
-rw-r--r--. 1 root root 10854 Jun 23 20:40 local.cf
2)

Code: Select all

[root@mx ~]# spamassassin --lint
Need to edit your rules if error appears

3)
[root@mx ~]# sa-update
[root@mx ~]# sa-compile
[root@mx ~]# systemctl restart spamassassin

Add: I also remove any loadplugin inside the local.cf
sergio_eristoff
Posts: 12
Joined: 27 Nov 2018 06:43

Re: Spamassassin local.cf ignored

Post by sergio_eristoff »

I have followed your instructions but still the same result. The local.cf is ignored by Spamassassin.
There were no errors with the mentioned commands.
User avatar
activateit
Posts: 8
Joined: 10 Jul 2019 03:17

Re: Spamassassin local.cf ignored

Post by activateit »

I now have a working spamassasin setup.

A fresh rocky 9.x/efa5 has this in the /etc/mail/spamassasin directory.
Note: The symlink for mailscanner.cf to /etc/MailScanner/spamassassin.conf

Code: Select all

drwxr-xr-x. 2 root root  4096 Jul  5 14:32 channel.d
-rw-r--r--. 1 root root  1647 Jul  5 14:32 init.pre
-rw-r--r--. 1 root root  6883 Jul 11 23:11 local.cf
lrwxrwxrwx. 1 root root    34 Jul  5 14:32 mailscanner.cf -> /etc/MailScanner/spamassassin.conf
drwx------. 2 root root  4096 Jul 12 00:00 sa-update-keys
-rw-r--r--. 1 root root    62 Apr 22 05:48 spamassassin-default.rc
-rwxr-xr-x. 1 root root    39 Apr 22 05:48 spamassassin-helper.sh
-rw-r--r--. 1 root root    55 Apr 22 05:48 spamassassin-spamc.rc
-rw-r--r--. 1 root root  2260 Jul  5 14:33 v310.pre
-rw-r--r--. 1 root root  1168 Apr 22 05:48 v312.pre
-rw-r--r--. 1 root root  2412 Jul  5 14:32 v320.pre
-rw-r--r--. 1 root root  1237 Apr 22 05:48 v330.pre
-rw-r--r--. 1 root root  1020 Apr 22 05:48 v340.pre
-rw-r--r--. 1 root root  1309 Jul  5 14:32 v341.pre
-rw-r--r--. 1 root root  1515 Jul  5 14:32 v342.pre
-rw-r--r--. 1 root root  1264 Jul  5 14:32 v343.pre
-rw-r--r--. 1 root root  1482 Apr 22 05:48 v400.pre
-rw-r--r--. 1 root root  1116 Jul  5 14:32 v401.pre
The system that was failing, was a fresh install and then a import of efa4 config following the instructions on the site to migrate.
The import doesn't get a couple of things right.

1. It removes the symlink and crates a mailscanner.cf file (forgot to save that file)
2. It changes the mailscanner.cf file, and gets the config for the geoip section wrong. Causing SpamAssassin to not load correctly.
I coped a working mailscanner.cf file from another machine that was just a install/config, only preserving the mysql section, I get a working spamassassin install.
sergio_eristoff
Posts: 12
Joined: 27 Nov 2018 06:43

Re: Spamassassin local.cf ignored

Post by sergio_eristoff »

@avtivateit Thank you for your answer. I tried your commands but it´s not helping.

I also get the following errors:

Code: Select all

 spamd[378040]: \x{00} at /var/lib/spamassassin/compiled/5.032/4.000001/Mail/SpamAssassin/CompiledRegexps/body_neg2000.pm line 17. spamd[378040]: Can't load '/var/lib/spamassassin/compiled/5.032/4.000001/auto/Mail/SpamAssassin/CompiledRegexps/body_neg2000/body_neg2000.so' for module Mail::SpamAssassin::CompiledRegexps::body_neg2000: /var/lib/spamassassin/compiled/5.032/4.000001/auto/Mail/SpamAssassin/CompiledRegexps/body_neg2000/body_neg2000.so: failed to map segment from shared object at /usr/share/>
 spamd[378040]: \x{00} at /var/lib/spamassassin/compiled/5.032/4.000001/Mail/SpamAssassin/CompiledRegexps/body_neg2000.pm line 17.
t spamd[378040]: BEGIN failed--compilation aborted at /var/lib/spamassassin/compiled/5.032/4.000001/Mail/SpamAssassin/CompiledRegexps/body_neg2000.pm line 18.
 spamd[378040]: Compilation failed in require at (eval 2100) line 1.
 spamd[378040]: Can't locate loadable object for module Geo::IP in @INC (@INC contains: /var/lib/spamassassin/compiled/5.032/4.000001 /var/lib/spamassassin/compiled/5.032/4.000001/auto /usr/share/perl5/vendor_perl /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/vendor_perl/Geo/IP.pm>
 spamd[378046]: razor2: razor2 check failed: Permission denied razor2: Can't read conf file: /var/spool/postfix/.razor/razor-agent.conf at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/Razor2.pm line 379.
 dccproc[378047]: open(/var/dcc/map): Permission denied
 dccproc[378047]: mmap(whiteclnt.dccx,42108): Permission denied
 spamd[378040]: dcc: instead of X-DCC header, dccproc returned 'open(/var/dcc/map): Permission denied'
User avatar
shawniverson
Posts: 3782
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Spamassassin local.cf ignored

Post by shawniverson »

spamd shouldn't be running, stop and disable it.

Code: Select all

sudo systemctl stop spamassassin
sudo systemctl disable spamassassin
User avatar
shawniverson
Posts: 3782
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Spamassassin local.cf ignored

Post by shawniverson »

activateit wrote: 12 Jul 2024 03:59 1. It removes the symlink and crates a mailscanner.cf file (forgot to save that file)
2. It changes the mailscanner.cf file, and gets the config for the geoip section wrong. Causing SpamAssassin to not load correctly.
I coped a working mailscanner.cf file from another machine that was just a install/config, only preserving the mysql section, I get a working spamassassin install.
https://github.com/E-F-A/eFa5/issues/10
cinmar
Posts: 3
Joined: 20 Jan 2020 10:11

Re: Spamassassin local.cf ignored

Post by cinmar »

Hello everyone, I wanted to disable the THREAD_INDEX_BAD rule in my eFa 5 because it is returning several false positives, but the modification to the /etc/mail/spamassassin/local.cf file is being ignored.

Following the instructions I found in previous posts, I edited /etc/mail/spamassassin/local.cf adding at the end of the file:

Code: Select all

score THREAD_INDEX_BAD 0
and then I used the following commands:

Code: Select all

spamassassin --lint
sa-update
sa-compile
And I did not restart SpamAssassin as shawniverson suggested.

Do I have to restart something else to get my score modification applied?
User avatar
shawniverson
Posts: 3782
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Spamassassin local.cf ignored

Post by shawniverson »

There is a spamassassin results cache database in MailScanner. You can

Code: Select all

sudo rm /var/spool/MailScanner/incoming/SpamAssassin.cache.db
and

Code: Select all

sudo systemctl restart mailscanner
to reset it.
Post Reply