This is the way, I implemented automatic updates of spamassasin rules for MailPlus Server on my Synology DS920+, running on DSM 7.0.
MY Finding: DSM 7.0 is using rspamd instead of spamassasin, this means, some older scripts, created for DSM 6 or earlier might not work anymore.
This script and description come with no warranty, I cannot held responsible, if something breaks on you machine!
- Create a file with the code snippet below on you machine (refenced as )
- Go to "Task Scheduler" and create a new task Run command: "bash " Run script as user "root" Run script every 2 hrs Optional: "Send run details per email"
- Let the task run manually and check the result
- Test the new rules, by sending a mail in from an external account with a trigger word from the new ruleset.
#!/bin/bash
SA_UPDATE="/var/packages/MailPlus-Server/target/bin/sa-update"
sa_files_folder="/var/spool/@MailPlus-Server/rspamd/sa_rules/update_db"
# Download via Spamassasin update tool
su MailPlus-Server -s /bin/sh -c "$SA_UPDATE --nogpg --channel spamassassin.heinlein-support.de -D -v --updatedir $sa_files_folder"
su MailPlus-Server -s /bin/sh -c "$SA_UPDATE --nogpg --channel sa.schaal-it.net -D -v --updatedir $sa_files_folder"
# Reload
/volume1/@appstore/MailPlus-Server/scripts/SpamRuleUpdate.sh local
/volume1/@appstore/MailPlus-Server/scripts/SpamRuleUpdate.sh all