- Plesk for Linux
- Plesk for Windows
How to train SpamAssassin on a Plesk server?
SpamAssassin is not pre-trained right after it is installed and enabled on a Plesk server.
To train it, each day during the Plesk Daily Maintenance Task, the utility
spamtrain is executed which launches the utility
sa-learn for each mailbox with enabled SpamAssassin.
To run this aspect of the Plesk Daily Maintenance Task manually on demand, follow the steps below:
Note: On Windows, start the Command Prompt before running the command.
Also, SpamAssassin can be trained manually:
- Enable Apply individual settings to spam filtering in Tools & Settings > Spam Filter
- Go to Domains > example.com > Email Addresses > email@example.com > Spam Filter.
- Press the OK button to apply the changes.
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.
Connect to the server using SSH.
Place all spam messages into one mailbox or a particular folder and use
For example, a domain example.com with spam-collector mailbox firstname.lastname@example.org. 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.