ASN

This plugin looks up the Autonomous System Number (ASN) of the connecting IP address and makes it available as a template tag. The ASN data is also added to the Bayesian filtering process, allowing the Bayesian filters to learn information based on the ASN of the connecting IP address.

How it works

Since SpamAssassin 4.0 it uses the local GeoDB (GeoIP ASN) database, which is recommended, while SpamAssassin 3.4.X uses DNS lookups to an external DNS zone.

Enable an ASN Lookup Provider

SpamAssassin 4.0.X

SpamAssassin 4.0 can use the local MaxMind ASN database to lookup ASN information for an IP address so it does not require that you use external lookups like SpamAssassin 3.4.X. Sign up for your free MaxMind API key and download the MaxMind databases if you haven't done so already. See here for more information.

SpamAssassin 3.4.X

Go to Warden -> Settings -> Plugin Settings -> ASN and set ASN lookup to:

origin.asn.cymru.com _ASN_ _ASNCIDR_

If using IPv6 set ASN lookup IPv6 to:

origin6.asn.cymru.com _ASN_ _ASNCIDR_

Press the update button to save the page.

Tags

The ASN plugin adds the following tags that are available for use in reports, header fields, and other plugins:

Tag Description
_ASN_ Autonomous System Number of the connecting IP address
_ASNCIDR_ The route announced by that ASN where the connecting IP address came from

If the AS announces multiple networks (more/less specific), they will all be added to the _ASNCIDR_ tag, separated by spaces, eg:

 X-Spam-ASN: AS1680 89.138.0.0/15 89.139.0.0/16

Note that the literal "AS" before the ASN in the _ASN_ tag is configurable through the asn_prefix directive and may be set to an empty string.

The local GeoDB (GeoIP ASN) lookups can only set the _ASN_ tag, they have no data for _ASNCIDR_. If you need both tags, then set asn_prefer_geodb to 0 so that DNS lookups are tried as well.

Headers

ASN _ASN_ _ASNCIDR_

The default config will add a header field that looks like this:

 X-Spam-ASN: AS24940 213.239.192.0/18

Where "24940" is the ASN and "213.239.192.0/18" is the route announced by that ASN where the connecting IP address came from.

Rules

Area Rule name Description Default scores
header ASN_BAD Email is relayed through one of the bad ASNs 3.25
header ASN_GOOD Email is relayed through one of the good ASNs -0.5

Related Pages