Problem Description
- You have a VPS or dedicated server running Plesk. You have root access to the server.
- Spam (and ham - good messages) training only occurs once every 24 hours, however you would like to move messages into their appropriate folders more frequently for good organization
Note: We are unable change the frequency of spam training on our shared servers due to the CPU intensity required and the large number of email accounts hosted upon them.
Problem Resolution
You can set up a Plesk Scheduled Task (cron job) that runs the following command to force it to train spam and ham:
/sbin/plesk daily ExecuteSpamtrain
Set the cron job to run more frequently to scan messages more frequently. We don't recommend running it more than a few times a day for performance reasons. If you wish to have ham (non-spam) trained in a folder other than Inbox, like Archive, you can create a cron job similar to the following example using the Archive folder:
sa-learn --ham /var/qmail/mailnames/testdomain.com/mailuser/Maildir/.Archive
If you're not certain if learning is occurring, you can get some stats like this:
ADDY=email@address.com
name=$(echo $ADDY | cut -d "@" -f 1)
domain=$(echo $ADDY | cut -d "@" -f 2)
sa-learn --dump magic --dbpath /var/qmail/mailnames/$domain/$name/.spamassassin/
---
Source 1: https://support.plesk.com/hc/en-us/articles/115003117405-How-to-train-SpamAssassin-on-Plesk-server-