You can manually train SpamAssassin to work with all mail accounts on the server from the command line.
To train SpamAssassin to work with all mail names on the server:
spam_mails
and ham_mails
.# 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
# find /var/qmail/mailnames/ -mindepth 2 -maxdepth 2 -type d -exec /bin/cp -f /var/qmail/mailnames/domain.com/mailname/.spamassassin/bayes_* {}/.spamassassin/ \;
where domain.com
and mailname
should be replaced with the real domain name and mail name.