Change all user's 'Required Score' for Apache SpamAssassin

jmf1993

Registered
Apr 24, 2018
4
0
1
U.K
cPanel Access Level
Root Administrator
I have searched and searched this forum. However, none of the advice seems work.

I am trying to update the 'required_score' setting on SpamAssassin for all my users.

- No user has any user configuration file
- I have ran the '/scripts/restartsrv_spamd' command after every single change that I have made.

Things I've tried:
- Updated the local.cf file to change the score from 5.0 in there. Both with the '#' added and without.
- Created a file 'custom.cf' and added the 'required_score' setting in there. Changed the file name to start with a 'Z'.

How is the setting for all user's still at '5.0', after trying all that?

I'd appreciate any assistance on the matter, please.

Many thanks.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
The users should have a user_prefs file at /home/$user/.spamassassin/user_prefs modifying the score here would modify the score for that account.

Is the issue that you're attempting to make the score 5.0 for all accounts at once by modifying /etc/mail/spamassassin/local.cf and the changes aren't being saved?


Thank you,
 

jmf1993

Registered
Apr 24, 2018
4
0
1
U.K
cPanel Access Level
Root Administrator
Thank you for your reply.

None of the users have any 'user_prefs' file. I've made sure of that. They've never changed any SpamAssassin setting.

I would like the score at 8.0 for all accounts but modifying the 'local.cf' file and restarting the service has no impact.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
hi @jmf1993

I'm testing this locally and trying to replicate. I've renamed my user's user_prefs,

Code:
mv /home/$user/.spamassassin/user_prefs{,.bk}
and modified the local.cf as follows:

Code:
# grep required_score /etc/mail/spamassassin/local.cf
required_score 2.0
Then ran
Code:
/scripts/update_spamassassin_config
and restarted spamd:

Code:
/scripts/restartsrv_spamd
The new score was immediately referenced for email sent to the user which I removed the user_prefs file for. Can you confirm that the issue persists after following the steps listed here?


Thank you,
 
  • Like
Reactions: martin MHC

jmf1993

Registered
Apr 24, 2018
4
0
1
U.K
cPanel Access Level
Root Administrator
Thank you so much the reply, and testing on your own server.

I followed the steps to the bone, and the problem sadly does still exist.

Do you have any other ideas of what it could be?

Many thanks.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
Hi @jmf1993

That should have done it unless there's something that's getting missed or you have some other customization there that's getting overlooked.

You're welcome to open a ticket using the link in my signature so we can take a closer look. If you do open one please reference the ticket ID here so we can update this thread with the outcome.


Thank you,
 

jmf1993

Registered
Apr 24, 2018
4
0
1
U.K
cPanel Access Level
Root Administrator
Hello,

So I went ahead and opened a support ticket, I'll paste their reply below.

Thank you very much for all your assistance yesterday.

Ticket number - 9464831

Hello,

Thank you for your patience. I was able to determine that the change you made was actually successful. If you view the headers of a received email, you can see the required score is set to 8.0. You can view the headers easily in webmail, just click 'More' then 'Show source' if you are in Roundcube.

The issue you are seeing is that this isn't updated in the cPanel interface. This is because the cPanel interface for SpamAsassin reads from the user_prefs and writes to the user_prefs. If the user defined preferences do not exist, it reads from a system file that cannot be changed since it gets reset when the server receives updates.

The good news is that the global configuration you created is in effect, you just can't see it in the user's cPanel and it will get overwritten if a user saves their configuration.

I would recommend creating a feature request to be able to modify the file below in order to be able to change the default required_score in the interface without the worry of the file getting overwritten when 'upcp' runs.

================================
/usr/local/cpanel/etc/spamassassin.options
================================

It is important to include this file in the feature request so that we know for sure what is being requested.

Here is the line in question:

================================
[00:44:15 server01 [email protected] ~]cPs# grep '=%.2f=' /usr/local/cpanel/etc/spamassassin.options
=%.2f=5;;
================================

When the number 5 is updated to something like say 8, the required score in cPanel gets updated to 8.

Feature requests are a very important aspect of cPanel's product growth. Now, to help us gather community input for future product enhancements, the cPanel Team has created a Feature Request section on the forums.

Previous forum requests were part of our internal tracking system, and it was often difficult to determine how strong popular demand was for certain features, and to engage ongoing discussions with a large group of people at one time.

With the new Feature Request Forum, you can read and comment on what other people are suggesting, add requests for features, and subscribe to topics via email, so you can stay informed as conversations and updates are made available.

As always, your business and ongoing relationship are important to us. Below is the URL to the Feature Request Forum:

cPanel & WHM Feature Requests

If you have any further questions regarding this issue, let me know and I will be happy to assist.
 

cPanelLauren

Technical Support Community Manager
Staff member
Nov 14, 2017
13,271
1,243
313
Houston
Hello,

I'm glad to hear that the changes worked! I'm also sorry that I didn't think to ask you how you were checking if the scores were not being changed. This is exactly what I did to confirm my findings yesterday (check the spam score on the actual email)

Thank you for updating us here on the outcome.