• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

SpamAssassin local.cf gets overwritten

riverwalk

New Pleskian
/etc/mail/spamassassin/local.cf

has the following

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

I need to know what file to modify so that my changes are not lost, when someone modifies settings in Plesk. I need to make changes to spamassassin globally for all email accounts no matter how many times the local.cf gets modified.
 
Hi,

thanks.
This note is missing on Debian/Ubuntu.

What exactly are you missing from /usr/local/psa/admin/sbin/spammng that requires you editing local.cf?

Regards,
Kristian
 
Hi,

thanks.
This note is missing on Debian/Ubuntu.

What exactly are you missing from /usr/local/psa/admin/sbin/spammng that requires you editing local.cf?

Regards,
Kristian

I'm not sure what /usr/local/psa/admin/sbin/spammng has to do with local.cf; it appears to be some type of startup script and has nothing to do with the local config file you'd use to override spam assassin settings?

In any case, the reason why I want to edit the local.cf is to alter some spam assassin settings that are on by default that I do not want on. I don't have the option to turn these particular settings off in Plesk, there is no place in Plesk to define custom settings for the local.cf file, and if I modify the actual SpamAssassin files, they'd just get wiped out during an rpm update, or if I modify the local.cf file, it would get wiped out if any change were made within Plesk related to SpamAssassin. So now there appears to be no way left to alter SA's settings without worrying about those changes disappearing at some point.

FYI: http://forum.parallels.com/showthread.php?299113-etc-mail-spamassassin-local-cf-vs-KB-article-1678

The notice seem to be missing only if the file was never touched by Plesk (i.e. on clean installation).

Correct; we set some Plesk preferences at install time that cause that file to be modified by Plesk so I've only ever seen it with the notice in place; for example:

#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
report_safe 0
rewrite_header subject *****SPAM******
required_score 3.0
 
Hi,

well spammng actually manages changes to local.cf file.

Code:
# /usr/local/psa/admin/sbin/spammng -r
[root@www02 spamassassin]# cat /etc/mail/spamassassin/local.cf 
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
report_safe 0
[root@www02 spamassassin]# /usr/local/psa/admin/sbin/spammng -s 7.0
[root@www02 spamassassin]# cat /etc/mail/spamassassin/local.cf 
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
report_safe 0
required_score 7.0

Regards,
Kristian
 
So are you suggesting I somehow modify /usr/local/psa/admin/sbin/spammng to always insert the information I need to have present in local.cf? How do I make those changes if so? And won't /usr/local/psa/admin/sbin/spammng just get replaced by Plesk updates?
 
Hi,

well I'm still not quite sure what changes you want to make to local.cf.

spammng is a CLI Tool for managing Spamassassin.
You can not edit it and yes it will be updated with Plesk.

spammng however saves your changes to local.cf within the psa Database (Table spamfilter_preferences) which makes your changes applied to the local.cf done by spammng persistent even over updates. At least as long as Parallels supports it :)

Regards,
Kristian
 
Here's the specific change I want to make:

score URIBL_BLACK 0
score URIBL_RED 0
score URIBL_GREY 0
score URIBL_BLOCKED 0

URIBL is NOT free for commercial use, therefore anyone using Plesk for commercial use, and who has enabled SpamAssassin, is therefore in violation of the URIBL's terms of use. URIBL is on by default in SpamAsassin. So I need a way to turn it off that will not be overwritten.
 
Hi again,

by the way.
All your user settings for Spamassassin that your Mailusers setup individually are also stored within the same Table in the Database and are then written to either local.cf or the respective user_prefs file.

So I do not think Parallels will be dropping support for it in the near future. But that should be the right way to customize your global and user specific Spamassassin configuration.

Hope it helps,
Kristian
 
Hi again,

well in that case the solution should be quite easy.
Don't bother editing local.cf just create a new file in /etc/mail/spamassassin/ with an *.cf extension.

If you then run "spamassassin --lint -D" you will see that your custom config file is also loaded.

Example:
#nano /etc/mail/spamassassin/local-modified.cf

# Insert:
score URIBL_BLACK 0
score URIBL_RED 0
score URIBL_GREY 0
score URIBL_BLOCKED 0

# spamassassin --lint -D 2> /tmp/test.log
# cat /tmp/test.log | grep local-modified.cf
Mär 11 17:51:46.697 [29897] dbg: config: read file /etc/mail/spamassassin/local-modified.cf

As you created a config file by yourself, Plesk is not aware of it and will never touch it at all.
It's actually a default spamassassin behaviour to include all *.cf files of /etc/mail/spamassassin/ and /usr/share/spamassassin/

I hope your issue is now resolved?

Regards,
Kristian
 
Last edited:
Maybe KristianM can help me with something since you seem to know about SA...

I want to find the config file which moves mail into the .Spam folder. Can you help?
 
Back
Top