Product:
Search Type:

Is it possible to train Spamassassin for all mail names on the server simultaneously?

Article ID: 1217 
Last Review: Oct,23 2007
APPLIES TO:
  • Plesk 7.5.x Reloaded
  • Plesk 8.x for Linux/Unix

RESOLUTION

There is no such feature in current Plesk version. However it can be done manually from the command line in the following way.

1. Store SPAM and HAM messages in two different folders, for example 'spam_mails'
and 'ham_mails'.

2. Train Spamassassin for one mailbox using the messages from that folders:


# cd /path/to/spam_mail/
# for message in * ; do /usr/local/psa/admin/sbin/spammng --bayes --mailname=mailname@domain.com --spam=$message ; done
# cd /path/to/ham_mail/
# for message in * ; do /usr/local/psa/admin/sbin/spammng --bayes --mailname=mailname@domain.com --ham=$message ; done


3. Then repeat this command for every mailbox on the server or just copy bayes bases (./domain.com/mailname/.spamassassin/bayes_*) from this mailbox to each other with:

# find /var/qmail/mailnames/  -mindepth 2 -maxdepth 2 -type d -exec /bin/cp -f /var/qmail/mailnames/domain.com/mailname/.spamassassin/bayes_* {}/.spamassassin/ \;


Note, 'domain.com' and 'mailname' should be replaced with the real domain name and mail name in the paths that are listed above.
Keywords: sa-learn train spamassassin spam ham

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields