Skip to main content
cPanel Technical Support has been heavily impacted by hurricane Beryl and our ability to respond to tickets has been hindered as a result. We appreciate your understanding and patience as we address these delays.

Help with spamassassin and PERL module GeoIP2::Database::Reader



  • cPRex Jurassic Moderator

    Hey there!  It looks like that tool is requiring additional Perl modules.  Were you able to install the  IP::Country::DB_File module as well?

  • rbairwell

    I think (and perhaps cPRex can confirm), that WHM's "Install a Perl Module"/"Module Installers" only installs it for usage by customers (aka the server's Perl binary)  - whereas SpamAssassin probably uses the "cPanel Perl" installation (which is built/configured to operate WHM/cPanel and auxiliary programs).

    If this is the case, you'll need to install the modules via the command line - lists which ones you probably need - but I know my server is running Perl 5.36 (instead of 532) so I'll need to use:

    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install GeoIP2::Database::Reader
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install IP::Country::DB_File
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install Net::Patricia
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install Net::DNS::Nameserver

    instead. To find out what version of "cPanel Perl" you are running, try:

    ls /usr/local/cpanel/3rdparty/bin/perl -alh

    which will return something like:

    lrwxrwxrwx 1 root root 44 Aug  5  2022 /usr/local/cpanel/3rdparty/bin/perl -> /usr/local/cpanel/3rdparty/perl/536/bin/perl

    with the "536" bit being the current version.

  • Nermin

    Hello, I did as you wrote:

    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install GeoIP2::Database::Reader
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install IP::Country::DB_File
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install Net::Patricia
    /usr/local/cpanel/3rdparty/perl/536/bin/cpan install Net::DNS::Nameserver

    and they are loading now without problems in lint.

    However, this all was in order to attempt block emails sent thru africa, south america, asia and some other countries around the world, if they were relayed thru some of the countries that I would list.

    I am using Mailscanner Front End from Configserver and I would like it to show up in header, but for some reason it does not show up.

    Here is header in MailScanner FE:

    It just writes _RELAYCOUNTRY_ without any country code.

    As far as I can understand it should write AR, BR, DE, or any country.

    Ive added this code to, and to init.pre and to
    loadplugin Mail::SpamAssassin::Plugin::RelayCountry
    ifplugin Mail::SpamAssassin::Plugin::RelayCountry
    add_header all Relay-Countries _RELAYCOUNTRY_
    add_header all Relay-Country _RELAYCOUNTRY_
    report X-Relay-Countries: _RELAYCOUNTRY_
    report X-Relay-Country: _RELAYCOUNTRY_
    header RC_GOD X-Relay-Countries =~ /(BA|HR|DE)/
    describe RC_GOD Relayed through a prohibited country at some point
    score RC_GOD 0.1

    Does anybody have any idea how to make this work, because a lot of hacked email accounts are used for phishing, and as far as I can see they are sent thru third countries arround the world.

    If there is some way to filter them out it would be awesome.

  • rbairwell

    For MailScanner specific questions, it'll be best to ask on the ConfigServer forums at as it is 3rd party software (and more chance of Chirpy - the developer - seeing and responding to it there)


Please sign in to leave a comment.