- Plesk for Linux
- Plesk for Windows
How can SpamAssassin be trained?
Note: SpamAssassin is not being trained by default. If you want to train it, please perform the steps below:
There are 3 ways to train SpamAssassin:
There is the utility
spamtrainin Plesk which is executed during the Daily Maintenance Task.
sa-learnfor each mailbox with enabled SpamAssassin.
Run Daily Maintenance Task manually with
# plesk daily ExecuteSpamtrain
Note: On Windows, Start Command Prompt before running the command.
In this case each mailbox will use its own spam base.
Manually by moving mails:
Train the spam filter and improve its accuracy by moving spam messages from
Spam, and non-spam messages from
Note: As all messages are automatically removed from the
Spamfolder after 30 days, review the contents of the
Spamfolder on a regular basis to make sure no important messages are missed, and move all non-spam messages back to the
Note: Such Spam training is performed on a daily basis by the Plesk daily task.
Manually via SSH (Linux):
Connect to the server via SSH.
Place all spam messages into one mailbox or a particular folder and use
For example, a domain example.com with spam-collector mailbox email@example.com. Point the path to the folder with spam to
# sa-learn --spam /var/qmail/mailnames/example.com/spam/Maildir/.Spam/cur/
sa-learnwill create/update its database with a new spam information and store it in the following files:
# ll /root/.spamassassin/
-rw------- 1 root root 12288 May 5 14:57 bayes_seen
-rw------- 1 root root 12288 May 5 14:57 bayes_toks
Сopy the above files to an appropriate mail folder of each required domain and mailbox:
# cp /root/.spamassassin/* /var/qmail/mailnames/example.com/spam/.spamassassin/
Change the ownership:
# chown -R popuser:popuser /var/qmail/mailnames/example.com/spam/.spamassassin/*
In this case each mailbox will use the same spam base.