---
title: 'antispam:training'
url: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-training'
markdown: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-training.md'
date: '2026-10-07'
description: "Configure the spam filter Bayes training cron task settings. warden --task=antispam:training Option Value Default Description --training_domains <string1,string2> all The domains to use for Bayes training. Use 'all' for all domains. --training_domains_add <string> Add a single entry…"
taxonomy:
  category:
    - docs
  tag:
    - bayes
---

[](#)  [ Basics ](https://docs.danami.com/warden/)     [ Command Line Interface ](https://docs.danami.com/warden/command-line-interface)      Antispam       antispam:training    

# antispam:training

Configure the spam filter Bayes training cron task settings.

```
warden --task=antispam:training
```

| Option | Value | Default | Description |
|---|---|---|---|
| `--training_domains` | <string1,string2> | all | The domains to use for Bayes training. Use 'all' for all domains. |
| `--training_domains_add` | <string> |  | Add a single entry to training\_domains. |
| `--training_domains_del` | <string> |  | Remove a single entry from training\_domains. |
| `--train_spam` | <1\|0> | 1 | Train Bayes using read mail from the users spam folder. |
| `--train_junk` | <1\|0> | 1 | Train Bayes using read mail from the users junk folder. |
| `--train_ham` | <1\|0> | 1 | Train Bayes using read mail from the users inbox. |
| `--training_max_size` | <digit> | 500 | Skip messages larger than this size (in KB). Defaults to 500 KB, Use 0 for no limit. |
| `--training_max_days` |  | 1 | The number of days of mail to include in training. High volume servers should use a shorter value to limit the amount of mail that is trained each training interval. |
| `--training_interval` | <disabled\|daily\|weekly\|monthly> | disabled | How often to perform the training. |
| `--training_hour` |  | 1 | The hour of day to do training. |
| `--training_day_of_week` |  | 0 | The day of week to do training (weekly training). |
| `--training_day_of_month` |  | 1 | The day of the month to do training (monthly training). |
| `--default` | <yes> |  | Reset all settings to their default values. |
| `--default_option` | <option> |  | Reset a specific setting to its default value. |
| `--run_task` | <yes> |  | Run the Bayes training cron task immediately. |

## Examples

```
// set the training domains to specific domains only
warden --task=antispam:training --training_domains=example.com,example2.com

// turn off ham training
warden --task=antispam:training --train_ham=0

// set the training to daily at 3:00 AM
warden --task=antispam:training --training_interval=daily --training_hour=3

// set the training to weekly every Sunday at 3:00 AM
warden --task=antispam:training --training_interval=weekly --training_day_of_week=0 --training_hour=3

// set the training to monthly on the 3rd of each month at 3:00 AM
warden --task=antispam:training --training_interval=monthly --training_day_of_month=3 --training_hour=3

// set the training training_max_size to 1000 KB
warden --task=antispam:training --training_max_size=1000

// turn off the Bayes training cron task
warden --task=antispam:training --training_interval=disabled

// reset training_interval to its default value
warden --task=antispam:training --default_option=training_interval

// reset all settings to their default values
warden --task=antispam:training --default=yes

// run the Bayes training cron task immediately
warden --task=antispam:training --run_task=yes

// train only the high volume domain once a week and limit it to the last day of mail
warden --task=antispam:training --training_domains=example.com --training_interval=weekly --training_day_of_week=0 --training_max_days=1
```

## Related Pages

- [Training Settings](https://docs.danami.com/warden/settings/antispam/training-settings "Training Settings")

 [ ](https://docs.danami.com/warden/command-line-interface/antispam/antispam-train) [](https://docs.danami.com/warden/settings/antispam/training-settings)

---

## Navigation

- Previous: [antispam:train](https://docs.danami.com/warden/command-line-interface/antispam/antispam-train.md)
