How can I manually train Warden with a set of spam or ham messages using the sa-learn command?

Bayes learning will normally not be enabled until at least 200 spam messages have been trained. Normally this is done automatically using the real-time learning, auto learning, or Plesk nightly training script but you may want to speed up the process by starting the training manually. You can use the /usr/bin/sa-learn command to train Warden.

To train a directory of bad messages as spam:

sa-learn -u amavis --no-sync --use-ignores --progress --spam /var/qmail/mailnames/example.com/johndoe/Maildir/.Spam/cur/

To train a directory of good messages as ham:

sa-learn -u amavis --no-sync --use-ignores --progress --ham /var/qmail/mailnames/example.com/johndoe/Maildir/cur

Sync the changes after you are done:

sa-learn -u amavis --sync

To view the current learning statistics from the command line (Statistics can also be viewed from the Warden dashboard under the Anti-spam Learning Statistics widget):

sa-learn --dump magic

 

  • sa-learn, training
  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

How can I change the interface language of the extension?

You can change the interface language under Settings -> Application Settings -> Locale...

How can I disable admin email notifications in Amavis?

Amavis has different default options for controlling where virus, spam, banned file attachments,...

Where are the configuration files for Warden located?

Centos/RHEL/CloudLinux/AlmaLinux Configuration files: // amavis (Content Filter Settings)...

How can I whitelist or blacklist a mail server from greylisting?

To Whitelist a Mail Server From Greylisting Navigate to Warden -> Settings ->...

How can I enable third party anti-virus signatures within Warden to improve the ClamAV detection rate?

Warden supports enabling third party anti-virus signatures to improve the detection rate. These...