---
title: 'antispam:plugin:relaycountry'
url: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-relaycountry'
markdown: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-relaycountry.md'
date: '2026-10-07'
description: 'Add metadata to the Bayesian filtering process, allowing the Bayesian filters to learn information based on countries. warden --task=antispam:plugin:relaycountry Option Value Default Description --relaycountry_bad_countries <string1,string2> If an email is relayed through any of these co…'
taxonomy:
  category:
    - docs
  tag:
    - relaycountry
---

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

# antispam:plugin:relaycountry

Add metadata to the Bayesian filtering process, allowing the Bayesian filters to learn information based on countries.

```
warden --task=antispam:plugin:relaycountry
```

| Option | Value | Default | Description |
|---|---|---|---|
| `--relaycountry_bad_countries` | <string1,string2> |  | If an email is relayed through any of these countries then apply the `RELAYCOUNTRY_BAD` rule to them. See: [https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) |
| `--relaycountry_bad_countries_add` | <string> |  | Add a single entry to relaycountry\_bad\_countries. |
| `--relaycountry_bad_countries_del` | <string> |  | Remove a single entry from relaycountry\_bad\_countries. |
| `--relaycountry_good_countries` | <string1,string2> |  | If an email is relayed through any of these countries then apply the `RELAYCOUNTRY_GOOD` rule to them. See: [https://en.wikipedia.org/wiki/ISO\_3166-1\_alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) |
| `--relaycountry_good_countries_add` | <string> |  | Add a single entry to relaycountry\_good\_countries. |
| `--relaycountry_good_countries_del` | <string> |  | Remove a single entry from relaycountry\_good\_countries. |
| `--relaycountry_bad_score` | <int> | 3.25 | The score to give any country matching the bad countries. |
| `--relaycountry_good_score` | <int> | -0.5 | The score to give any country matching the good countries. |
| `--default` | <yes> |  | Reset all settings to their default values. |
| `--default_option` | <option> |  | Reset a specific setting to its default value. |
| `--reload` | <yes> |  | Reload the service after saving settings. |

## Examples

```
// set the relaycountry_bad_countries
warden --task=antispam:plugin:relaycountry --relaycountry_bad_countries=cn,bg,by --reload=yes

// reset relaycountry_bad_countries to its default value
warden --task=antispam:plugin:relaycountry --default_option=relaycountry_bad_countries --reload=yes

// reset all settings to their default values
warden --task=antispam:plugin:relaycountry --default=yes --reload=yes

// penalize mail relayed through Russia and boost mail relayed through trusted countries
warden --task=antispam:plugin:relaycountry --relaycountry_bad_countries_add=ru --relaycountry_good_countries=us,ca,de --relaycountry_bad_score=5 --reload=yes
```

## Related Pages

- [RelayCountry Settings](https://docs.danami.com/warden/settings/antispam/plugin-settings/relaycountry "RelayCountry Settings")
- [RelayCountry](https://docs.danami.com/warden/user-guide/antispam-plugins/relaycountry "RelayCountry")

 [ ](https://docs.danami.com/warden/user-guide/antispam-plugins/relaycountry) [](https://docs.danami.com/warden/settings/antispam/plugin-settings/relaycountry)

---

## Navigation

- Previous: [antispam:plugin:redirectors](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-redirectors.md)
- Next: [antispam:plugin:rulestatistics](https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-rulestatistics.md)
