• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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