Using the RelayCountry plugin
The RelayCountry plugin exposes the countries that a mail was relayed from – turn it on by reading that documentation page, installing the required CPAN module (see below), and uncommenting the 'loadplugin' line in the /etc/mail/spamassassin/init.pre
file for Mail::SpamAssassin::Plugin::RelayCountry
.
Required CPAN module dependencies, choose one:
GeoIP2::Reader::Database | Supported since SpamAssassin 3.4.2, install MaxMind::DB::Reader::XS for best performance |
IP::Country::DB_File | Supported since SpamAssassin 3.4.2 |
Geo::IP | Supported since SpamAssassin 3.4.0 |
IP::Country::Fast | Not recommended, outdated |
Country metadata will also be added to the Bayesian filtering process, allowing it to learn information based on countries.
...
Perhaps the easiest to install, since most distributions package these.
Note that Geo::IP updates are discontinued since April 2018, so you should use the new GeoIP2 (MMDB) databases. Free and commercial versions can be found from several vendors:
...