• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Prefered Way to add Custom Rules in Spamassassin

I have added verbose option and all looks fine:

# sa-update -v --nogpg --channel spamassassin.heinlein-support.de
Update available for channel spamassassin.heinlein-support.de
Update was available, and was downloaded and installed successfully

You can check this solution at least and inform us with results.
 
Hi Igor,

the Installation works without any Errors...
But the Rules are not active or work correctly?!
 
You can add true "custom rules", (rules of your own), like your own whitelist, local spam, etc... too

/etc/mail/spamassassin/local.cf

Here is a little example of what ours hold.

whitelist_from *@linulex.com
whitelist_from *@parallels.com
whitelist_from *@odin.com
whitelist_from *@reports.spamcop.net
whitelist_from *@spamcop.net

body EURODICE /EuroDice Exchange Casino/i
describe EURODICE EuroDice Exchange Casino
score EURODICE 500.0

body WOMENOFDISTINCTION /Community of Professional Women/i
describe WOMENOFDISTINCTION Community of Professional Women
score WOMENOFDISTINCTION 500.0


body EUROPEESBEDRIJF /Exclusief aanbod voor Nederlandse spelers/i
describe EUROPEESBEDRIJF Nederlandse spelers
score EUROPEESBEDRIJF 500.0

body EUROPEESBEDRIJF /Een groot Europees bedrijf is op zoek naar de kandidaten voor beschikbare vacatures/i
describe EUROPEESBEDRIJF Een groot Europees bedrijf
score EUROPEESBEDRIJF 500.0

Hopes this helps the fight against spam a bit

regards
Jan
 
Linulex, that file starts:

Code:
#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.

... so that doesn't seem like the best of ideas.

That said, does anyone know which file you are actually supposed to put your custom rules in so that Plesk doesn't overwrite them? The warning message isn't very helpful given that it doesn't say where you SHOULD put them.
 
Hi Enverex,

even that the file "/etc/mail/spamassassin/local.cf" shows the mentioned text, you still should use it for custom configurations. Plesk will not generate or create a new "local.cf" - file, but could overwrite some settings, which you set over the Plesk control Panel as for example:

rewrite_header subject XXXXX
required_score XXXXX
whitelist_from XXXXX


Another tip:
You could add "report_contact [email protected]" since the "report_contact" will else show the standard configuration from your spamassassin installation files, which is "the administrator of that system", in your mails.
 
Hi all,

I just want to present my solution here. I checked the file /etc/cron.daily/60sa-update and found out that Plesk/Odin just updates the filters and restarts the service. Similar to this I set up the following cronjob:

Code:
/usr/bin/sa-update -v --nogpg --channel spamassassin.heinlein-support.de && /opt/psa/admin/sbin/spammng --condrestart


This seems to work as expected but I'm not sure if an sa-compile is necessary after sa-update. This package isn't even installed on my server... has anybody any further information?
 
I ended up adding a 61-saupdate-heinleinsupport-rules text file (chmod 755) in the /etc/cron.daily directory with the below content:

Code:
#!/bin/sh
/usr/bin/sa-update --nogpg --channel spamassassin.heinlein-support.de > /dev/null 2>&1
env PATH=/opt/psa/admin/sbin:/usr/local/psa/admin/sbin:$PATH spammng --condrestart > /dev/null 2>&1
 
Last edited:
Hi Janko1000 ,

You could use:

Code:
sa-update --nogpg --channel spamassassin.heinlein-support.de && /usr/bin/sa-compile --quiet && /etc/init.d/spamassassin reload

... or use one of the provided bash - scripts, which you could find using Google: http://lmgtfy.com/?q="bash"+"sa-update+--nogpg+--channel"+"sa-compile"

:)

HI,
so i run this Code and done?
Nothing else?
Just
Code:
sa-update --nogpg --channel spamassassin.heinlein-support.de && /usr/bin/sa-compile --quiet && /etc/init.d/spamassassin reload
?
I dont have to set ( https://debroot.de/spamassassin-mit-heinlein-support-rule-updates/ ) CRON to 1 in
/etc/default/spamassassin ??
 
Hi daanse,

Plesk already installed a crontab for the Plesk-Spamassassin... pls. check your crontabs to verify. ;)
 
Hmm I can't find this cron job is in Onyx on Centos? Do you have a pointer? Is it still there? When I run
/usr/share/spamassassin/sa-update.cron
It just times out.
 
I never looked at plesk crons, i just run my own crons periodicly

centos 6

sa-update -v && /etc/init.d/spamassassin restart
sa-update -v --nogpg --channel spamassassin.heinlein-support.de && /etc/init.d/spamassassin restart

centos 7

sa-update -v && systemctl restart spamassassin.service
sa-update -v --nogpg --channel spamassassin.heinlein-support.de && systemctl restart spamassassin.service

regards
Jan
 
HI,
can i do something like this to have updated two rules at same time?
Code:
sa-update -v --nogpg --channel spamassassin.heinlein-support.de && sa-update -v --nogpg --channel sought.rules.yerp.org && systemctl restart spamassassin.service

UHM, sorry.
found this in the docs:

--channel <channel>

sa-update by default only uses the updates.spamassassin.org channel for updates. If other channels should be used, specify it with this option. For multiple channels, specify this option multiple times. ie: sa-update --channel updates.spamassassin.org --channel saupdates.example.com
 
Back
Top