The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Spamassassin relay country & Can't locate loadable object for module Geo::IP

Discussion in 'E-mail Discussions' started by bloatedstoat, Oct 29, 2015.

  1. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Hello.

    I've enabled loadplugin Mail::SpamAssassin::Plugin::RelayCountry and have the following in a custom.cf file

    Code:
    header RELAYCOUNTRY_BAD X-Relay-Countries =~ /^(IN|CN)/
    describe RELAYCOUNTRY_BAD Relayed through China or India at some point
    score RELAYCOUNTRY_BAD 3.0
    
    header RELAYCOUNTRY_GOOD X-Relay-Countries =~ /^(AU|NZ)/
    describe RELAYCOUNTRY_GOOD First trusted relay is Australia or New Zealand
    score RELAYCOUNTRY_GOOD -1.1
    
    I ran /usr/local/cpanel/3rdparty/bin/spamassassin --lint and the following warning came up:


    warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.

    Comment out Mail::SpamAssassin::Plugin::RelayCountry and the error goes away

    Then /usr/local/cpanel/3rdparty/bin/spamassassin --lint -D in debug mode and this is an excerpt:

    Code:
    dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x41cc5a8) implements 'extract_metadata', priority 0
    warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.
    dbg: metadata: RelayCountry: Using database: Geo::IP GEO-106FREE 20140701 Build 1 Copyright (c) 2014 MaxMind Inc All Rights Reserved
    dbg: metadata: X-Relay-Countries:
    dbg: check: tagrun - tag AUTHORDOMAIN is now ready, value: compiling.spamassassin.taint.org
    dbg: check: tagrun - tag RELAYSTRUSTED is now ready, value:
    dbg: check: tagrun - tag RELAYSUNTRUSTED is now ready, value:
    dbg: check: tagrun - tag RELAYSINTERNAL is now ready, value:
    dbg: check: tagrun - tag RELAYSEXTERNAL is now ready, value:
    dbg: check: tagrun - tag LANGUAGES is now ready, value: <UNDEF>
    dbg: message: no encoding detected
    dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x41cc5a8) implements 'parsed_metadata', priority 0
    dbg: plugin: Mail::SpamAssassin::Plugin::URIDNSBL=HASH(0x42679f0) implements 'parsed_metadata', priority 0
    dbg: plugin: Mail::SpamAssassin::Plugin::Shortcircuit=HASH(0x444dcd0) implements 'parsed_metadata', priority 0
    [B]dbg: check: tagrun - tag RELAYCOUNTRY is now ready, value: ARY:[][/B]
    
    Above *appears* to suggest chocks away.

    /scripts/restartsrv_spamd and watching the logs I see this:

    Code:
    Oct 30 08:16:12 andromeda spamd[582417]: Can't locate loadable object for module Geo::IP in @INC (@INC contains: /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4 /opt/cpanel/perl5/514/site_lib/x86_64-linux-64int /opt/cpanel/perl5/514/site_lib) at /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Geo/IP.pm line 42
    
    Searched for Geo and get this:

    find /usr/local -name Geo -print
    ls -al /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Geo/IP.pm

    Anyone know what and why please:

    • warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.
    • Can't locate loadable object for module Geo::IP

    Oddly it appears to be triggering regardless as a message in the maillog shows:

    spamd: result: RELAYCOUNTRY_GOOD

    Like to remove the errors in the maillog despite it apparently working as hoped for.

    Thank you.
     
    #1 bloatedstoat, Oct 29, 2015
    Last edited by a moderator: Nov 10, 2015
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    11.52.0.20
     
  4. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Hello again. Wondered if it is because one of the other modules is unavailable.
    Does this help?

    Code:
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: Digest::SHA1, version 2.13
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: HTML::Parser, version 3.71
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: Net::DNS, version 0.74
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: NetAddr::IP, version 4.072
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: Time::HiRes, version 1.9726
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: Archive::Tar, version 1.96
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: IO::Zlib, version 1.10
    Nov  3 08:49:40.564 [171073] dbg: diag: [...] module installed: Digest::SHA1, version 2.13
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: MIME::Base64, version 3.14
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: DB_File, version 1.831
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Net::SMTP, version 2.33
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Mail::SPF, version v2.009
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Geo::IP, version 1.45
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module not installed: Net::CIDR::Lite ('require' failed)
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Razor2::Client::Agent, version 2.84
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module not installed: IO::Socket::IP ('require' failed)
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: IO::Socket::INET6, version 2.72
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: IO::Socket::SSL, version 1.988
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Compress::Zlib, version 2.064
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Mail::DKIM, version 0.4
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: DBI, version 1.633
    Nov  3 08:49:40.565 [171073] dbg: diag: [...] module installed: Getopt::Long, version 2.42
    Nov  3 08:49:40.566 [171073] dbg: diag: [...] module installed: LWP::UserAgent, version 6.05
    Nov  3 08:49:40.566 [171073] dbg: diag: [...] module installed: HTTP::Date, version 6.02
    Nov  3 08:49:40.566 [171073] dbg: diag: [...] module installed: Encode::Detect::Detector, version 1.01
    Nov  3 08:49:40.566 [171073] dbg: diag: [...] module not installed: Net::Patricia ('require' failed)
    Nov  3 08:49:40.566 [171073] dbg: diag: [...] module installed: Net::DNS::Nameserver, version 1145
    
     
    #4 bloatedstoat, Nov 2, 2015
    Last edited by a moderator: Nov 10, 2015
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Thanks Michael.
    I installed it as per above command:

    Ran lint:

    Code:
    /usr/local/cpanel/3rdparty/bin/spamassassin --lint
    
    Nov 10 18:17:44.443 [646057] warn: plugin: failed to parse plugin (from @INC): Can't locate Mail/SpamAssassin/Plugin/CIDRlight.pm in @INC (@INC contains: lib /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4 /opt/cpanel/perl5/514/site_lib/x86_64-linux-64int /opt/cpanel/perl5/514/site_lib) at (eval 112) line 1.
    Nov 10 18:17:45.861 [646057] warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.
    
    Checked again (seems it's there but SA can't see it?)

    Code:
    [root ~]# cpan -i Net::CIDR::Lite
    Loading internal null logger. Install Log::Log4perl for logging messages
    CPAN: Storable loaded ok (v2.20)
    Reading '/home/.cpan/Metadata'
    Database was generated on Tue, 10 Nov 2015 02:53:42 GMT
    CPAN: Module::CoreList loaded ok (v2.18)
    Net::CIDR::Lite is up to date (0.21).
    
     
    #6 bloatedstoat, Nov 10, 2015
    Last edited by a moderator: Nov 10, 2015
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    /usr/local/bin/spamassassin
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Try moving it out of the way and linking it to the correct spamassassin binary. EX:

    Code:
    mv /usr/local/bin/spamassassin /usr/local/bin/spamassassin-old
    ln -s /usr/local/cpanel/3rdparty/bin/spamassassin /usr/local/bin/spamassassin
    Thank you.
     
  10. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Thanks for this, I have followed your suggestion and now ls -l reports:

    /usr/local/bin/spamassassin -> /usr/local/cpanel/3rdparty/bin/spamassassin

    Lint still produces the following error though.

    [root@xxxx ~]# /usr/local/cpanel/3rdparty/bin/spamassassin --lint

    Nov 11 09:49:42.611 [1004248] warn: plugin: failed to parse plugin (from @INC): Can't locate Net/CIDR/Lite.pm in @INC (@INC contains: lib /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib /usr/local/cpanel /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4/x86_64-linux-64int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.4 /opt/cpanel/perl5/514/site_lib/x86_64-linux-64int /opt/cpanel/perl5/514/site_lib) at (eval 1204) line 1.
    Nov 11 09:49:43.438 [1004248] warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.

    Incidentally, SA debug still insists that the following are not installed yet I installed all of them with cpan -i

    dbg: diag: [...] module not installed: Net::CIDR::Lite ('require' failed)
    dbg: diag: [...] module not installed: IO::Socket::IP ('require' failed)
    dbg: diag: [...] module not installed: Net::Patricia ('require' failed)
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you open a support ticket using the link in my signature so we can take a closer look? You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
  12. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Thanks Michael.
    #7382603
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    To update, the issue was addressed by installing the missing modules through the "/usr/local/cpanel/scripts/perlinstaller" command. EX:

    Code:
    /usr/local/cpanel/scripts/perlinstaller CDB_File
    Thank you.
     
  14. bloatedstoat

    bloatedstoat Well-Known Member

    Joined:
    Jun 14, 2012
    Messages:
    76
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    Victoria, Australia
    cPanel Access Level:
    Root Administrator
    Indeed this resolved most of my troubles. This line however does persist which is GEO::IP related.

    "warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520."

    I have been given advice by one of the cpanel staff "The issue appears to be known and can be reviewed via Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 34) line 5520 · Issue #156 · E-F-A/v3 · GitHub but this isn't something we'd be able to correct."

    Which leads very neatly onto my question.

    I note that there are several locations of this module on our CloudLinux CageFS server.
    • /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Geo/IP.pm
    • /usr/share/cagefs-skeleton/usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Geo/IP.pm
    If I were to patch this module manually as per the information provided at the GitHub URL above, which file should I edit?

    Possible to advise on this?
     
  15. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You could modify /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/Geo/IP.pm but keep in-mind that updates will overwrite the file so you may need to create a hook that modifies the file each time cPanel updates:

    Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

    The CageFS-skeleton directory is documented at:

    CageFS > Configuration > Mount Points

    Thank you.
     
Loading...

Share This Page