We are receiving a huge amount of spam daily (around 200+ messages).
So I tried to change the SpamAssassin score in HestiaCP. I simply uncommented this line and changed its value from 5.0 to 4.0:
# required_score 5.0
to
required_score 4.0
(/etc/spamassassin/local.cf)
But when I Save, this error appears:
Error: ERROR: spamassassin failed to start with new configuration.
What is causing this problem?
How did you edit the local.cf file?
Show the output of these commands:
cat -A /etc/spamassassin/local.cf | grep -Ev '^$|^#'
spamassassin --lint
I edited the local.cf file using the HestiaCP web interface.
(https://myserver :port/edit/server/spamassassin/)
I usually avoid using the command line as much as possible.
Ok, I suppose you are using Ubuntu 24.04 and in that OS, Hestia uses spamassassin as the service name instead of the correct one, that is spamd:
The file you edited should be fine, only doesnât work the service restart.
To fix the issue execute this command as root:
sudo /usr/local/hestia/bin/v-change-sys-config-value ANTISPAM_SYSTEM spamd
Then you could restart the service from Hestia and editing the local.cf file should work fine too.
Thanks, the fix worked perfectly!
I ran the command:
sudo /usr/local/hestia/bin/v-change-sys-config-value ANTISPAM_SYSTEM spamd
After that, the SpamAssassin service restarted normally, and now I can edit the local.cf file through the HestiaCP panel without any errors.
Changing required_score is working fine now.
Just one more question:
Isnât this a bug in HestiaCP? Shouldnât it automatically detect the correct service name on Ubuntu 24.04 instead of using the wrong one by default?
Thank you.
Youâre welcome. Iâm glad it worked
Yes, it is. I made a PR 4 months ago to fix it:
main â sahsanu:fix-spamassassin-service-name-ubuntu-24.04
opened 03:11PM - 25 Nov 25 UTC
Ubuntu 24.04 renamed the SpamAssassin service from `spamassassin` to `spamd`, pr⌠eventing Hestia from restarting it via the Web UI.
- Use `spamd` for Ubuntu 24.04+ in installer
- Add migration logic in upgrade script for existing installations
- Preserve `spamassassin` for older Ubuntu versions
I forgot to say that if you change the score in spamassassin you should also change the score used by Exim.
Note : Exim doesnât use floating numbers so instead of 4.0 you should use 40 but internally it will be 4.
From this:
SPAM_SCORE = 50
To this:
SPAM_SCORE = 40