Mail::SpamAssassin::Plugin::ASN − SpamAssassin plugin to look up the Autonomous System Number (ASN) of the connecting IP address.


 loadplugin Mail::SpamAssassin::Plugin::ASN
 asn_lookup _ASN_ _ASNCIDR_
 add_header all ASN _ASN_ _ASNCIDR_


This plugin uses DNS lookups to the services of "" to do the actual work. Please make sure that your use of the plugin does not overload their infrastructure − this generally means that you should not use this plugin in a high-volume environment or that you should use a local mirror of the zone (see "").


This plugin allows you to create template tags containing the connecting IP ’s AS number and route info for that AS number.

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

 X−Spam−ASN: AS24940

where " AS24940 " is the ASN and "" is 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


The standard ruleset contains a configuration that will add a header containing ASN data to scanned messages. The bayes tokenizer will use the added header for bayes calculations, and thus affect which BAYES_* rule will trigger for a particular message.

Note that in most cases you should not score on the ASN data directly. Bayes learning will probably trigger on the _ASNCIDR_ tag, but probably not very well on the _ASN_ tag alone.

SEE ALSO − all data regarding routing, ASNs etc − SpamAssassin Issue #4770 concerning this plugin


No in-depth analysis of the usefulness of bayes tokenization of ASN data has been performed.


asn_lookup asn− [ _ASNTAG_ _ASNCIDRTAG_ ]

Use this to 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.

If no tags are specified the AS number will be added to the _ASN_ tag and the routing info will be added to the _ASNCIDR_ tag. You must specify either none or both of the tags. Tags must start and end with an underscore.

If two or more asn_lookups use the same set of template tags, the results of their lookups will be appended to each other in the template tag values in no particular order. Duplicate results will be omitted when combining results. In a similar fashion, you can also use the same template tag for both the AS number tag and the routing info tag.


  asn_lookup _ASN_ _ASNCIDR_
  asn_lookup _MYASN_ _MYASNCIDR_
  asn_lookup _ASNDATA_ _ASNDATA_

More Linux Commands

snmpstatus(1) - retrieves a fixed set of management informat
snmpstatus is an SNMP application that retrieves several important statistics from a network entity. AGENT identifies a target SNMP agent, which is instrumented

uuid_clear(3) - reset value of UUID variable to the NULL val
The uuid_clear function sets the value of the supplied uuid variable uu to the NULL value. AUTHOR Theodore Y. Tso AVAILABILITY libuuid is part of the util-linux

sane-kvs40xx(5) SANE backend for Panasonic KV-S40xxC USB SCS
The sane-kvs40xx library implements a SANE (Scanner Access Now Easy) backend which provides access to the Panasonic KV-S40xxC and KV-S70xxC scanners. KNOWN ISSU

slk_init(3ncurses) - curses soft label routines (Man Page)
The slk* functions manipulate the set of soft function-key labels that exist on many terminals. For those terminals that do not have soft labels, curses takes o

sysctl.d(5) - Configure kernel parameters at boot (ManPage)
At boot, systemd-sysctl.service(8) reads configuration files from the above directories to configure sysctl(8) kernel parameters. CONFIGURATION FORMAT The confi

tuned-main.conf(5) Tuned global configuration file..........
This man page documents format of the Tuned global configuration file. The tuned-main.conf file uses the ini-file format. dynamic_tuning=BOOL This defines wheth

Tcl_CreateThread(3) - Tcl thread support - Linux man page...
Tcl provides Tcl_CreateThread for creating threads. The caller can determine the size of the stack given to the new thread and modify the behaviour through the

getrpcent_r(3) - get RPC entry (reentrant) - Linux man page
The getrpcent_r(), getrpcbyname_r(), and getrpcbynumber_r() functions are the reentrant equivalents of, respectively, getrpcent(3), getrpcbyname(3), and getrpcb

perlre(1) - Perl regular expressions - Linux manual page....
This page describes the syntax of regular expressions in Perl. If you havent used regular expressions before, a quick-start introduction is available in perlreq

chmod(1) - change file mode bits (Commands - Linux man page)
This manual page documents the GNU version of chmod. chmod changes the file mode bits of each given file according to mode, which can be either a symbolic repre

sane-find-scanner(1) - find SCSI and USB scanners and their
sane-find-scanner is a command-line tool to find SCSI and USB scanners and determine their Unix device files. Its primary aim is to make sure that scanners can

mysqldump(1) - a database backup program - Linux man page...
The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or tran

We can't live, work or learn in freedom unless the software we use is free.