You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by Apache Wiki <wi...@apache.org> on 2018/09/25 16:05:14 UTC

[Spamassassin Wiki] Update of "RelayCountryPlugin" by HenrikKrohns

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Spamassassin Wiki" for change notification.

The "RelayCountryPlugin" page has been changed by HenrikKrohns:
https://wiki.apache.org/spamassassin/RelayCountryPlugin?action=diff&rev1=16&rev2=17

  = Using the RelayCountry plugin =
- The [[http://spamassassin.apache.org/full/3.0.x/dist/doc/Mail_SpamAssassin_Plugin_RelayCountry.html|RelayCountry]] plugin exposes the countries that a mail was relayed from -- turn it on by reading that documentation page, installing the required CPAN module {{{IP::Country::Fast}}}, and uncommenting the 'loadplugin' line in the {{{/etc/mail/spamassassin/init.pre}}} file for {{{Mail::SpamAssassin::Plugin::RelayCountry}}}.
+ The [[http://spamassassin.apache.org/full/3.4.x/dist/doc/Mail_SpamAssassin_Plugin_RelayCountry.html|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}}}.
  
- The [[http://spamassassin.apache.org/full/3.0.x/dist/doc/Mail_SpamAssassin_Plugin_RelayCountry.html|RelayCountry]] plugin will add metadata to the Bayesian filtering process, allowing the Bayesian filters to learn information based on countries.
+ Required CPAN module dependencies, choose one:
+ ||GeoIP2::Reader::Database||Supported since SpamAssassin 3.4.2||
+ ||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.
  
  You can also write rules that match specific countries and add them to your {{{/etc/mail/spamassassin/local.cf}}} file.  For example:
  
@@ -30, +36 @@

  {{{
     X-Spam-Relay-Country: US CN RU
  }}}
+ 
+ === Note about GeoIP2::Reader::Database and Geo::IP ===
+ Perhaps the easiest to install, since most distributions package these.
+ 
+ === Note about IP::Country::DB_File ===
+ This module does not come with a database or update mechanism, but it is quite easy and fast to [[https://metacpan.org/pod/IP::Country::DB_File::Builder|create yourself]] (it does need a bit of hacking, mentioned urls are outdated).
+ 
+ Easier way is to download a daily generated database, sponsored by [[HenrikKrohns]]:
+ 
+ http://mailfud.org/ip-country-dbfile/
+ 
+ The gunzipped file can be placed anywhere, just let SpamAssassin know where it is (country_db_path setting).
+ 
- === Note about IP::Country::Fast database ===
+ === Note about IP::Country::Fast ===
- As of writing, the latest version of IP::Country::Fast is three years old, meaning the bundled database is as old. There is no internal update mechanism.
+ As of writing, the latest included database is from 2013. There is no internal update mechanism.
  
  The database consists of files named ''cc.gif'' and ''ip.gif''. You can find the path with this command:
  
  {{{
     $ perl -MIP::Country::Fast -e '$_=$INC{"IP/Country/Fast.pm"};s/\.pm/\n/;print';
  }}}
- Updating the database files requires entering dbmScripts directory in [[http://cpansearch.perl.org/src/NWETTERS/IP-Country-2.27/dbmScripts/|IP::Country::Fast sources]] and running ''whois_filenames'', ''ipcc_loader.pl'' and ''ipcc_maker.pl'' scripts in that order. Note that the build can use up to 2GB of system memory.
+ Updating the database files requires entering dbmScripts directory in [[http://cpansearch.perl.org/src/NWETTERS/IP-Country-2.27/dbmScripts/|IP::Country::Fast sources]] and running ''whois_filenames'', ''ipcc_loader.pl'' and ''ipcc_maker.pl'' scripts in that order. Note that the build can use up to 2GB of system memory. The files must be put in directory mentioned above, it is not configurable.
  
- Alternatively, you can download premade files provided by [[Hege]]. These should be updated once a month or so:
+ Here you download occasionally updated files sponsored by [[HenrikKrohns]]:
  
  http://mailfud.org/ip-country-fast/
  
- '''Note: '''Geo::IP support was recently [[http://svn.apache.org/viewvc?view=revision&revision=1308059|added]] to SpamAssassin 3.4 trunk, so you should use that if possible!
-