• 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

Question SpamAssassin Update Cron

fliegerhermi

Regular Pleskian
I am just working on spam-protection in plesk 12.5
I installed a script which generates a list to inform clients about a list of spam mails in the .SPAM-Folder so that they are informed about false positives in case they are using POP3.

Anyway while doing this I wanted to install a cron that runs sa-update (which updates SpamAssassin-Rules) on a regular basis.

I found the following code in /etc/cron.daily/spamassassin
Code:
#!/bin/sh

# This task was disabled by psa-spamassassin package
exit 0

I went trough the docs, but I couldn't figure out why you did this.
If the customer disables Antispam, than the serverwide-rules don't apply anyway or did I get that wrong?
Thank you for your help!
Cheers!
Max
 
Hi fliegerhermi,

the correct way to use "sa-update" as a cronjob would be for example:

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

If the "psa-spamassassin" - package disabled your task, it might be the case, that you used a command, which is already included in the "daily-maintenance" task from Plesk.
 
Hi, thanks for your quick reply. I never enabled a task since I saw this default message of the plesk dev team. Just wanted to make sure, that I don't break anything.

Thank you

EDIT:
I just found the file /etc/cron.daily/60sa-update

Code:
#!/bin/sh
### Copyright 1999-2015. Parallels IP Holdings GmbH. All Rights Reserved.

sa_update()
{
        /usr/bin/sa-update
        local rc="$?"
        case $rc in
                # Only restart spamd if sa-update returns 0, meaning it updated the rules
                0) env PATH=/opt/psa/admin/sbin:/usr/local/psa/admin/sbin:$PATH spammng --condrestart ;;
                # If sa-update returns 1 then there are no updates
                1) exit 0 ;;
        esac
        return $rc
}

sa_update >> /var/log/sa-update.log 2>&1

I could modify it, but I guess it will be overwritten on a possible plesk update.
Is a developer on the forum to describe how I should proceed to add a custom ruleset from an external provider?

Thanks
 
Last edited:
Just create own Scheduled Task with necessary command - Tools & Settings -> Scheduled Tasks
 
Back
Top