---
title: 'antispam:plugin:asn'
url: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-asn'
markdown: 'https://docs.danami.com/warden/command-line-interface/antispam/antispam-plugin-asn.md'
date: '2026-09-22'
description: 'Add metadata to the Bayesian filtering process, allowing the Bayesian filters to learn information based on the ASN of the connecting IP address. warden --task=antispam:plugin:asn Option Value Description --asn_use_geodb <1|0> Use the Mail::SpamAssassin::GeoDB module to lookup ASN…'
taxonomy:
  category:
    - docs
  tag:
    - asn
---

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

# antispam:plugin:asn

Add metadata to the Bayesian filtering process, allowing the Bayesian filters to learn information based on the ASN of the connecting IP address.

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

| Option | Value | Description |
|---|---|---|
| `--asn_use_geodb` | <1\|0> | Use the Mail::SpamAssassin::GeoDB module to lookup ASN numbers. Make sure to set the MaxMind license under Settings -> Geolocation Settings so that the Maxmind ASN database can be downloaded. GeoDB can only set *ASN* tag, it has no data for *ASNCIDR*. If you need both, then set asn\_prefer\_geodb 0 so DNS rules are tried. |
| `--asn_prefer_geodb` | <1\|0> | If set, DNS lookups (asn\_lookup rules) will not be run if GeoDB successfully finds ASN. Set this to 0 to get *ASNCIDR* even if GeoDB finds *ASN*. |
| `--asn_use_dns` | <1\|0> | Set to 0 to never allow DNS queries. |
| `--asn_prefix` | <string> | The string specified in the argument is prepended to each ASN when storing it as a tag. |
| `--asn_lookup` | <string1,string2> | Lookup the ASN info in the specified zone for the first external IP address and add the AS number to the first specified tag and routing info to the second specified tag. |
| `--asn_lookup_add` | <string> | Add a single entry to asn\_lookup. |
| `--asn_lookup_del` | <string> | Remove a single entry from asn\_lookup. |
| `--asn_lookup_ipv6` | <string> | Use specified zone for lookups of IPv6 addresses. If zone supports both IPv4 and IPv6 queries, use both asn\_lookup and asn\_lookup\_ipv6 for the same zone. |
| `--asn_lookup_ipv6_add` | <string> | Add a single entry to asn\_lookup\_ipv6. |
| `--asn_lookup_ipv6_del` | <string> | Remove a single entry from asn\_lookup\_ipv6. |
| `--asn_bad_asns` | <string1,string2> | If an email is relayed though any of these ASNs then apply the ASN\_BAD score to them. |
| `--asn_bad_asns_add` | <string> | Add a single entry to asn\_bad\_asns. |
| `--asn_bad_asns_del` | <string> | Remove a single entry from asn\_bad\_asns. |
| `--asn_bad_score` | <int> | The score to give any ASN matching the bad ASNs. |
| `--asn_good_asns` | <string1,string2> | If an email is relayed though any of these ASNs then apply the ASN\_GOOD score to them. |
| `--asn_good_asns_add` | <string> | Add a single entry to asn\_good\_asns. |
| `--asn_good_asns_del` | <string> | Remove a single entry from asn\_good\_asns. |
| `--asn_good_score` | <int> | The score to give any ASN matching the good ASNs. |
| `--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 asn_bad_score
warden --task=antispam:plugin:asn --asn_bad_score=4.00 --reload=yes

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

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

## Related Pages

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

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

---

## Navigation

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