Update spam score for all users

zomebodi

Verified User
Joined
Sep 3, 2023
Messages
54
Is there a way to update the spam score filter to all users from 5 to 7.5 on a bash?
 
It's possible on new user creation, with the user_create_post.sh script like @jamgames2 said, you can put a default 7,5 values in the prefs file.

But if you want to modify it for all users in a massive way, you need something like a perl -pi -e command or a sed command.
Maybe something like:
sed -i 's/5/7\.5/g' /home/*/.spamassassin/user_prefs
do not use this command as is!! as it's just an example. I'm not sure if this is correct.
So I would suggest to first create a backup user_prefs from some user with the values in side, for example /root/user_prefs and then try like this:
sed -i 's/5/7\.5/g' /root/user_prefs
if this works correctly, then the string might be correct, but use at your own risk!
 
none any easy ways to modifier all Users.

If you don't want to mess up your server, I suggest use API Call "CMD_API_SPAMASSASSIN", must combined with other API like get all username or get all domains name. It will do same jobs as in Control Panel.

Bash can call API by curl.

Or via some simple cli call
Code:
sed -i 's/required_score.*/required_score 7\.5/' /home/*/.spamassassin/user_prefs
#note: do not execute this command until you make sure it do what you want. I suggest testing for one user before do regex all users.
 
Back
Top