antispam:train

Perform Bayes training from the command line interface.

Make sure that the location of maildirs PLESK_MAILNAMES_D is set properly in /etc/psa/psa.conf

warden --task=antispam:train --oper=<train_spam|train_ham|untrain_spam|untrain_ham|force_expire|statistics|reset_training>
Option
Value Description
--oper <string> The operation you want to perform. Operations: train_spam, train_ham, untrain_spam, untrain_ham, force_expire, statistics, reset_training
--domains <string1,string2> The domains to use for Bayes training. Use 'all' for all domains.
--mailboxes <string1,string2> The mailboxes to use for Bayes training.
--max_days <digit> The maximum number of days of mail to include in training. Spam training will default to 30 days. Ham training will default to 7 days.
--max_size <digit> Skip messages larger than this size (in KB). Defaults to 500KB, Use 0 for no limit.
--debug <string1,String2> Print debugging messages (area1,area2). Use 'all' for all areas.
--progress <1|0> Show a progress indicator when training.

Examples

// train spam for all domains
warden --task=antispam:train --oper=train_spam --domains=all --progress=1

// train ham for all domains
warden --task=antispam:train --oper=train_spam --domains=all --progress=1

// train spam for specific domains
warden --task=antispam:train --oper=train_spam --domains=example1.com,example2.com --progress=1

// train ham for specific domains
warden --task=antispam:train --oper=train_ham --domains=example1.com,example2.com --progress=1

// train spam for specific mailboxes
warden --task=antispam:train --oper=train_spam --mailboxes=test@example1.com,test@example2.com --progress=1

// train ham for specific mailboxes
warden --task=antispam:train --oper=train_ham --mailboxes=test@example1.com,test@example2.com --progress=1

// train ham for a specific mailbox using the last 30 days of unread mail with a max size of 1000 KB. 
warden --task=antispam:train --oper=train_ham --mailboxes=test@example1.com --max_days=30 --max_size=1000 --progress=1

// force expire of old tokens out of the database
warden --task=antispam:train --oper=force_expire

// get training statistics
warden --task=antispam:train --oper=statistics

// delete all bayes training data from the database
warden --task=antispam:train --oper=reset_training