You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@spamassassin.apache.org on 2019/07/21 14:32:45 UTC

[Bug 7741] New: Invalid database type 0 error when enabling URILocalBL

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

            Bug ID: 7741
           Summary: Invalid database type 0 error when enabling URILocalBL
           Product: Spamassassin
           Version: 3.4 SVN branch
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Plugins
          Assignee: dev@spamassassin.apache.org
          Reporter: marcel.evenson@gmail.com
  Target Milestone: Undefined

My config:

> ifplugin Mail::SpamAssassin::Plugin::URILocalBL
> uri_block_cc URILOCALBL_BAD_COUNTRY al dz
> describe URILOCALBL_BAD_COUNTRY Block URIs pointing to bad countries
> score URILOCALBL_BAD_COUNTRY 3.25
> endif

Running spamassassin --lint
> # spamassassin --lint
> Invalid database type 0

My setup:
> # spamassassin -V
> SpamAssassin version 3.4.3-rc3 running on Perl version 5.16.3

My test RPM was built on release svn1862889:
> # rpm -qa | grep spamassassin
. spamassassin-3.4.3-0.20190710svn1862889.el7.x86_64

Also note that the RelayCountry plugin is working fine do there isn't anything
wrong with the GeoIP2::Database::Reader or the GeoIP databases.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #13 from Marcel <ma...@gmail.com> ---
Sorry Henry also note that I was building test RPMS from SVN to do some testing
for you guys before the final 3.4.3 release . The build was
spamassassin-3.4.3-0.20190710svn1862889.el7.x86_64. 

If you look at the trunk for the 3.4 branch you can see that the code is there:

https://github.com/apache/spamassassin/blob/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm#L373

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #19 from Henrik Krohns <ap...@hege.li> ---
(In reply to Marcel from comment #18)
> OK it looks like the only way to get rid of the error when perl-Geo-IP is
> also installed is to explicitly set uri_country_db_path
> /usr/share/GeoIP/GeoLite2-City.mmdb in the config. Then GeoIP2 will be used
> for URILocalBL also.

This is correct. URILocalBL has no concept of default search paths or anything
similar to RelayCountry which does things separately. All this is fixed in
4.0.0, so will be left as it is.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #3 from Henrik Krohns <ap...@hege.li> ---
PS. One missing dependency might be MaxMind::DB::Reader

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #8 from Marcel <ma...@gmail.com> ---
It just speeds up the process of installing all the GeoIP2 dependencies.

As you can see if I remove the --notest it builds fine:

> cpanm --sudo GeoIP2::Database::Reader         
--> Working on GeoIP2::Database::Reader
Fetching http://www.cpan.org/authors/id/M/MA/MAXMIND/GeoIP2-2.006002.tar.gz ...
OK
> Configuring GeoIP2-2.006002 ... OK
> Building and testing GeoIP2-2.006002 ... OK
L> Successfully installed GeoIP2-2.006002
> 1 distribution installed

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Marcel <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #21 from Marcel <ma...@gmail.com> ---
Sorry Henry. For some reason it looks like RelayCountry is not working with the
GeoLite2-City.mmdb file even though it reports that it opens the database OK :(

With country_db_type GeoIP2 and geoip2_default_db_path
/usr/share/GeoIP/GeoLite2-City.mmdb RelayCountry only reports XX for countries
now. 

I double checked and GeoIP2::Database::Reader is supposed to support all geo
databases https://metacpan.org/pod/GeoIP2::Database::Reader

I'm not sure if this is a bug in the RelayCountry code or
GeoIP2::Database::Reader. I'm using version 2.006002 of the reader. Setting the
 geoip2_default_db_path to GeoLite2-Country.mmdb fixes it.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #16 from Henrik Krohns <ap...@hege.li> ---
Added City to search

Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm
Transmitting file data .done
Committing transaction...
Committed revision 1863531.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #10 from Henrik Krohns <ap...@hege.li> ---
Here is what I see for spamassassin-3.4 svn, please try these exact commands.

$ spamassassin --cf 'country_db_type GeoIP2' --lint -D 2>&1 | grep -i relayc
Jul 21 19:04:15.460 [21623] dbg: plugin: loading
Mail::SpamAssassin::Plugin::RelayCountry from @INC
Jul 21 19:04:16.808 [21623] dbg: plugin:
Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x556929eec390) implements
'extract_metadata', priority 0
Jul 21 19:04:16.815 [21623] dbg: metadata: RelayCountry: Using database: GeoIP2
GeoLite2 Country database / Mon Jul 15 20:52:37 2019
Jul 21 19:04:16.815 [21623] dbg: check: tagrun - tag RELAYCOUNTRY is now ready,
value: ARY:[]
Jul 21 19:04:16.815 [21623] dbg: check: tagrun - tag RELAYCOUNTRYEXT is now
ready, value: ARY:[]
Jul 21 19:04:16.815 [21623] dbg: check: tagrun - tag RELAYCOUNTRYAUTH is now
ready, value: ARY:[]
Jul 21 19:04:16.815 [21623] dbg: check: tagrun - tag RELAYCOUNTRYALL is now
ready, value: ARY:[]

$ spamassassin --cf 'country_db_type GeoIP' --lint -D 2>&1 | grep -i relayc
Jul 21 19:04:56.033 [21641] dbg: plugin: loading
Mail::SpamAssassin::Plugin::RelayCountry from @INC
Jul 21 19:04:57.372 [21641] dbg: plugin:
Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x555b701500f0) implements
'extract_metadata', priority 0
Jul 21 19:04:57.372 [21641] dbg: metadata: RelayCountry: Using database:
Geo::IP IPv4: GEO-106FREE 20180327 Build 1 Copyright (c) 2018 MaxMind Inc All
Rights Reserved / IPv6: GEO-106FREE 20180918 Build 1 Copyright (c) 2018 MaxMind
Inc All Rights Reserved
Jul 21 19:04:57.372 [21641] dbg: check: tagrun - tag RELAYCOUNTRY is now ready,
value: ARY:[]
Jul 21 19:04:57.372 [21641] dbg: check: tagrun - tag RELAYCOUNTRYEXT is now
ready, value: ARY:[]
Jul 21 19:04:57.372 [21641] dbg: check: tagrun - tag RELAYCOUNTRYAUTH is now
ready, value: ARY:[]
Jul 21 19:04:57.372 [21641] dbg: check: tagrun - tag RELAYCOUNTRYALL is now
ready, value: ARY:[]

I'm pretty sure you simply have some wrong or missing database or config option
or something like that.

The 3.4 codebase is horrible even logging wise, it was all rewritten for 4.0.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #23 from Giovanni Bechis <gi...@paclan.it> ---
If a GeoLite2-City.mmdb sample database could be sent to one of the devs, we
could add support for it in SA 4.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #24 from Marcel <ma...@gmail.com> ---
Henry yes I understand. It's just a pain trying to maintain 2 different
databases (when the city one has the exact same info). Giovanni the Maxmind
city databases are available here:
https://dev.maxmind.com/geoip/geoip2/geolite2/ if you want to download them.

After looking at the GeoIP2::Database::Reader code I think its just a matter of
calling $reader->city() vs $reader->country() when using the city databases.
The objects look the same its just that the city object just has more data.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #1 from Marcel <ma...@gmail.com> ---
Also note my OS:

> # cat /etc/redhat-release 
> CentOS Linux release 7.6.1810 (Core) 

GeoIP2::Database::Reader was installed using cpanm:

> curl -L https://cpanmin.us | perl - --sudo App::cpanminus
> cpanm --self-upgrade --sudo
> cpanm --sudo --notest File::Which --force
> cpanm --sudo --notest GeoIP2::Database::Reader

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #25 from Giovanni Bechis <gi...@paclan.it> ---
(In reply to Marcel from comment #24)
> Henry yes I understand. It's just a pain trying to maintain 2 different
> databases (when the city one has the exact same info). Giovanni the Maxmind
> city databases are available here:
> https://dev.maxmind.com/geoip/geoip2/geolite2/ if you want to download them.
> 
Sorry, I thought it was a commercial database, I did not know that the city
database was publicly available.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Marcel <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #12 from Marcel <ma...@gmail.com> ---
Can the RelayCountry plugin not use the free GeoLite2-City.mmdb database? It
looks like the plugin doesn't check for the presence for GeoLite2-City.mmdb
(which it should?) as it would be able to work with it as it uses the exact 
same format as the Maxmind country DB (they should be 100% compatible).


spamassassin --cf 'country_db_type GeoIP2' --lint -D 2>&1 | grep -i relayc
>Jul 21 10:17:41.118 [32330] dbg: plugin: loading Mail::SpamAssassin::Plugin::RelayCountry from @INC
>Jul 21 10:17:42.172 [32330] dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x41bf708) implements 'extract_metadata', priority 0
>Jul 21 10:17:42.172 [32330] dbg: metadata: RelayCountry: GeoIP2: database not found from default locations, trying IP::Country::Fast as fallback
>Jul 21 10:17:42.173 [32330] dbg: metadata: RelayCountry: failed to load 'IP::Country::Fast', skipping: Can't locate IP/Country/Fast.pm in @INC (@INC contains: lib /usr/share/perl5/vendor_perl /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 320.
>Jul 21 10:17:42.181 [32330] dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x41bf708) implements 'parsed_metadata', priority 0
>Jul 21 10:17:42.182 [32330] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 397.
>Jul 21 10:17:42.182 [32330] dbg: check: tagrun - tag RELAYCOUNTRY is now ready, value: ARY:[]
>Jul 21 10:17:42.182 [32330] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 402.
>Jul 21 10:17:42.182 [32330] dbg: check: tagrun - tag RELAYCOUNTRYEXT is now ready, value: ARY:[]
>Jul 21 10:17:42.182 [32330] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 407.
>Jul 21 10:17:42.183 [32330] dbg: check: tagrun - tag RELAYCOUNTRYAUTH is now ready, value: ARY:[]
>Jul 21 10:17:42.183 [32330] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 412.
>Jul 21 10:17:42.183 [32330] dbg: check: tagrun - tag RELAYCOUNTRYALL is now ready, value: ARY:[]

> # ls -la /usr/share/GeoIP/
> total 63236
> drwxr-xr-x.   2 root root     4096 Jan 17  2019 .
> drwxr-xr-x. 140 root root     4096 Jul 20 08:31 ..
> lrwxrwxrwx.   1 root root       17 Jan 17  2019 GeoIP.dat -> GeoIP-initial.dat
> -rw-r--r--.   1 root root  1242574 Oct 30  2018 GeoIP-initial.dat
> lrwxrwxrwx.   1 root root       19 Jan 17  2019 GeoIPv6.dat -> GeoIPv6-initial.dat
> -rw-r--r--.   1 root root  2322773 Oct 30  2018 GeoIPv6-initial.dat
> -rw-r--r--.   1 root root 61169072 Jul 13 01:00 GeoLite2-City.mmdb

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #4 from Marcel <ma...@gmail.com> ---
I did have the old perl-Geo-IP module installed.

yum remove perl-Geo-IP

But now with it removed I now get errors from the RelayCountry plugin:

>  spamassassin --lint
> Jul 21 09:13:40.323 [4473] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 397.
> Jul 21 09:13:40.323 [4473] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 402.
> Jul 21 09:13:40.323 [4473] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 407.
> Jul 21 09:13:40.324 [4473] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 412.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Henrik Krohns <ap...@hege.li> ---
Try looking what debug output shows: spamassassin --lint -D 

Also even if the module is installed, doesn't mean it will work, since it can
have runtime dependencies.

I never used cpanm, but why are you using --notest flag, it's important to
test. Basic cpan would work like:

cpan
look GeoIP2::Database::Reader
perl Makefile.PL
make
make test

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #22 from Henrik Krohns <ap...@hege.li> ---
Rolling back the City change to be safe..

Sending        RelayCountry.pm
Transmitting file data .done
Committing transaction...
Committed revision 1863742.

I don't have much time to investigate now, and 3.4.3 should really be finalized
and released already, so I suggest the simple fix is simply downloading the
Country.mmdb for your use. Since it's free it should be no problem?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #15 from Marcel <ma...@gmail.com> ---
OK I grabbed the latest RelayCountry.pm from 3.4 trunk then set
geoip2_default_db_path /usr/share/GeoIP/GeoLite2-City.mmdb and all looks to be
working now:

> # spamassassin --cf 'country_db_type GeoIP2' --lint -D 2>&1 | grep -i relayc
> Jul 21 11:05:05.092 [24025] dbg: plugin: loading Mail::SpamAssassin::Plugin::RelayCountry from @INC
> Jul 21 11:05:07.145 [24025] dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x459e360) implements 'extract_metadata', priority 0
> Jul 21 11:05:07.162 [24025] dbg: metadata: RelayCountry: Using database: GeoIP2 GeoLite2 City database / Mon Jun 24 12:23:29 2019
> Jul 21 11:05:07.162 [24025] dbg: check: tagrun - tag RELAYCOUNTRY is now ready, value: ARY:[]
> Jul 21 11:05:07.163 [24025] dbg: check: tagrun - tag RELAYCOUNTRYEXT is now ready, value: ARY:[]
> Jul 21 11:05:07.163 [24025] dbg: check: tagrun - tag RELAYCOUNTRYAUTH is now ready, value: ARY:[]
> Jul 21 11:05:07.163 [24025] dbg: check: tagrun - tag RELAYCOUNTRYALL is now ready, value: ARY:[]

No errors on # spamassassin --lint :)

So I think the only thing that needs to be done is to add GeoLite2-City.mmdb to
the fallback for RelayCountry and maybe URILocalBL plugins so that
geoip2_default_db_path doesn't have to be explicitly set when using the maxmind
city databases. 

Many thanks again Henry for helping me sort this out :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache@hege.li
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Henrik Krohns <ap...@hege.li> ---

Quick fix to not die completely on load errors.

You do not have GeoIP2::Database::Reader properly installed, since "Invalid
database type" can only come from old Geo::IP module. Make sure when you
install module you test them, it's possible some dependency is missing etc.

Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/URILocalBL.pm
Transmitting file data .done
Committing transaction...
Committed revision 1863526.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #9 from Marcel <ma...@gmail.com> ---
All dependencies are installed and all tests pass but still get the same error:

# Versions for all modules listed in MYMETA.json (including optional ones):
# 
# === Configure Requires ===
# 
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker  any 6.68
# 
# === Build Requires ===
# 
#     Module              Want Have
#     ------------------- ---- ----
#     ExtUtils::MakeMaker  any 6.68
# 
# === Test Requires ===
# 
#     Module                Want     Have
#     --------------------- ---- --------
#     ExtUtils::MakeMaker    any     6.68
#     File::Spec             any     3.40
#     HTTP::Response         any     6.04
#     HTTP::Status           any     6.03
#     IO::Compress::Gzip     any    2.061
#     MaxMind::DB::Metadata  any 0.040001
#     Path::Class            any     0.37
#     Test::Builder          any 1.001014
#     Test::Fatal            any    0.014
#     Test::More            0.96 1.001014
#     Test::Number::Delta    any     1.06
#     base                   any     2.18
#     utf8                   any     1.09
# 
# === Test Recommends ===
# 
#     Module         Want     Have
#     ---------- -------- --------
#     CPAN::Meta 2.120900 2.120921
# 
# === Runtime Requires ===
# 
#     Module                   Want     Have
#     -------------------- -------- --------
#     B                         any     1.35
#     Data::Dumper              any    2.145
#     Data::Validate::IP       0.25     0.27
#     Exporter                  any     5.68
#     Getopt::Long              any      2.4
#     HTTP::Headers             any     6.05
#     HTTP::Request             any     6.00
#     JSON::MaybeXS             any 1.004000
#     LWP::Protocol::https      any     6.04
#     LWP::UserAgent            any     6.05
#     List::SomeUtils           any     0.56
#     List::Util                any     1.50
#     MIME::Base64              any     3.13
#     MaxMind::DB::Reader  1.000000 1.000013
#     Moo                       any 2.003004
#     Moo::Role                 any 2.003004
#     Params::Validate          any     1.29
#     Scalar::Util              any     1.50
#     Sub::Quote                any 2.006003
#     Throwable::Error          any 0.200013
#     Try::Tiny                 any     0.30
#     URI                       any     1.60
#     lib                       any     0.63
#     namespace::clean          any     0.27
#     strict                    any     1.07
#     warnings                  any     1.13
# 
t/00-report-prereqs.t ....................... ok   
t/GeoIP2/Database/Reader-Anonymous-IP.t ..... ok    
t/GeoIP2/Database/Reader-ASN.t .............. ok   
t/GeoIP2/Database/Reader-Connection-Type.t .. ok   
t/GeoIP2/Database/Reader-Domain.t ........... ok   
t/GeoIP2/Database/Reader-Enterprise.t ....... ok   
t/GeoIP2/Database/Reader-ISP.t .............. ok   
t/GeoIP2/Database/Reader.t .................. ok     
t/GeoIP2/Error/Type.t ....................... ok   
t/GeoIP2/Model/City.t ....................... ok    
t/GeoIP2/Model/Country.t .................... ok    
t/GeoIP2/Model/Insights.t ................... ok    
t/GeoIP2/Model/names.t ...................... ok   
t/GeoIP2/Types.t ............................ ok     
t/GeoIP2/WebService/Client.t ................ ok    
All tests successful.
Files=15, Tests=500,  4 wallclock secs ( 0.09 usr  0.07 sys +  3.12 cusr  0.93
csys =  4.21 CPU)
Result: PASS
[root@el7p17 GeoIP2-2.006002-lV1mDk]# spamassassin --lint
Jul 21 10:00:11.992 [24926] warn: Use of uninitialized value in split at
/usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 397.
Jul 21 10:00:11.992 [24926] warn: Use of uninitialized value in split at
/usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 402.
Jul 21 10:00:11.993 [24926] warn: Use of uninitialized value in split at
/usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 407.
Jul 21 10:00:11.993 [24926] warn: Use of uninitialized value in split at
/usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 412.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #27 from Henrik Krohns <ap...@hege.li> ---

Should now work..

Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm
Sending        spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/URILocalBL.pm
Transmitting file data ..done
Committing transaction...
Committed revision 1863776.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #20 from Marcel <ma...@gmail.com> ---
Understood. Thanks again!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #18 from Marcel <ma...@gmail.com> ---
OK it looks like the only way to get rid of the error when perl-Geo-IP is also
installed is to explicitly set uri_country_db_path
/usr/share/GeoIP/GeoLite2-City.mmdb in the config. Then GeoIP2 will be used for
URILocalBL also.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #26 from Marcel <ma...@gmail.com> ---
Here is a proposed fix for this. Just change line 202
https://github.com/apache/spamassassin/blob/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm#L202

From:
$country = $db->country( ip => $ip );

To:
if (index($db->metadata()->description()->{en} ,'City') != -1) {
 $country = $db->city( ip => $ip );
} else {
 $country = $db->country( ip => $ip );
}

I've confirmed that this fix works for both the GeoIP2 city and country
databases. If you guys want I could submit patches for RelayCountry.pm and
URILocalBL.pm.

Normally I wouldn't care much about the 3.4.3 branch but with Centos 8 out in
the coming months that means that its going to be stuck with 3.4.3 for a
decade.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Marcel <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #6 from Marcel <ma...@gmail.com> ---
Would you like me to open a different ticket as to the RelayCountry problem ?

 spamassassin --lint -D shows that the GeoIP2::Database::Reader is being loaded
but still getting the RelayCountry errors now that the perl-Geo-IP module is
removed.

>  spamassassin --lint -D 
> Jul 21 09:44:27.708 [17958] dbg: diag: [...] optional module installed: GeoIP2::Database::Reader, version 2.006002

spamassassin --lint

> Jul 21 09:49:21.364 [20106] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 397.
> Jul 21 09:49:21.364 [20106] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 402.
> Jul 21 09:49:21.365 [20106] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 407.
> Jul 21 09:49:21.365 [20106] warn: Use of uninitialized value in split at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line 412.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #14 from Henrik Krohns <ap...@hege.li> ---
(In reply to Marcel from comment #12)
> Can the RelayCountry plugin not use the free GeoLite2-City.mmdb database? It
> looks like the plugin doesn't check for the presence for GeoLite2-City.mmdb
> (which it should?) as it would be able to work with it as it uses the exact 
> same format as the Maxmind country DB (they should be 100% compatible).

I might add it to default search path if you test it first:

geoip2_default_db_path path/to/your-City.mmdb

Or simply link the filename to -> City.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Marcel <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marcel.evenson@gmail.com
                 OS|Windows NT                  |Linux

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Giovanni Bechis <gi...@paclan.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovanni@paclan.it

--- Comment #11 from Giovanni Bechis <gi...@paclan.it> ---

> [root@el7p17 GeoIP2-2.006002-lV1mDk]# spamassassin --lint
> Jul 21 10:00:11.992 [24926] warn: Use of uninitialized value in split at
> /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line
> 397.
> Jul 21 10:00:11.992 [24926] warn: Use of uninitialized value in split at
> /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line
> 402.
> Jul 21 10:00:11.993 [24926] warn: Use of uninitialized value in split at
> /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line
> 407.
> Jul 21 10:00:11.993 [24926] warn: Use of uninitialized value in split at
> /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/RelayCountry.pm line
> 412.

what do you have in those lines of code ?
RelayCountry plugin doesn't have all those lines of code.

https://github.com/apache/spamassassin/blob/spamassassin_release_3_4_3_rc_3/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

--- Comment #5 from Marcel <ma...@gmail.com> ---
MaxMind::DB::Reader and GeoIP2::Database::Reader are both installed fine.

> perl -MMaxMind::DB::Reader -e1
> perl -MGeoIP2::Database::Reader -e1

Both show no errors.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7741] Invalid database type 0 error when enabling URILocalBL

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7741

Marcel <ma...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #17 from Marcel <ma...@gmail.com> ---
Unfortunately I did up some new RPMs after the latest commits and this isn't
completely fixed. When the perl-Geo-IP module is also installed spamassassin
will still display the Invalid database type 0 error even when country_db_type
GeoIP2 and geoip2_default_db_path /usr/share/GeoIP/GeoLite2-City.mmdb is set in
the config.

Note: perl-Geo-IP needs to be on the system as its required by the awstats
package.

># spamassassin --lint
>Invalid database type 0

The RelayCountry plugin:
>spamassassin --lint -D 2>&1 | grep -i RelayCountry
>Jul 22 04:53:51.895 [16493] dbg: plugin: loading Mail::SpamAssassin::Plugin::RelayCountry from @INC
>Jul 22 04:53:53.349 [16493] dbg: plugin: Mail::SpamAssassin::Plugin::RelayCountry=HASH(0x3e5f178) implements 'extract_metadata', priority 0
>Jul 22 04:53:53.363 [16493] dbg: metadata: RelayCountry: Using database: GeoIP2 GeoLite2 City database / Mon Jul 15 11:54:14 2019
>Jul 22 04:53:53.363 [16493] dbg: check: tagrun - tag RELAYCOUNTRY is now ready, value: ARY:[]
>Jul 22 04:53:53.363 [16493] dbg: check: tagrun - tag RELAYCOUNTRYEXT is now ready, value: ARY:[]
>Jul 22 04:53:53.363 [16493] dbg: check: tagrun - tag RELAYCOUNTRYAUTH is now ready, value: ARY:[]
>Jul 22 04:53:53.363 [16493] dbg: check: tagrun - tag RELAYCOUNTRYALL is now ready, value: ARY:[]

The URILocalBL plugin:
>spamassassin --lint -D 2>&1 | grep -i URILocalBL
>Jul 22 04:55:04.651 [19000] dbg: plugin: loading Mail::SpamAssassin::Plugin::URILocalBL from @INC
>Jul 22 04:55:05.109 [19000] dbg: config: uri_block_cc added URILOCALBL_BAD_COUNTRY
>Jul 22 04:55:06.238 [19000] dbg: check: uri_local_bl evaluating rule URILOCALBL_BAD_COUNTRY using database Geo::IP GEO-106FREE 20180327 Build 1 Copyright (c) 2018 MaxMind Inc All Rights Reserved
>Jul 22 04:55:06.238 [19000] dbg: check: uri_local_bl URILOCALBL_BAD_COUNTRY no match

The Geo databases:
># ls -la /usr/share/GeoIP/
>total 84588
>drwxr-xr-x    2 root root     4096 Apr 15 03:01 .
>drwxr-xr-x. 123 root root     4096 Jul 20 10:29 ..
>lrwxrwxrwx    1 root root       17 Jan  6  2019 GeoIP.dat -> GeoIP-initial.dat
>-rw-r--r--    1 root root       19 Apr 15 03:01 GeoIP.dat.test
>-rw-r--r--    1 root root  1242574 Oct 30  2018 GeoIP-initial.dat
>lrwxrwxrwx    1 root root       19 Jan  6  2019 GeoIPv6.dat -> GeoIPv6-initial.dat
>-rw-r--r--    1 root root  2322773 Oct 30  2018 GeoIPv6-initial.dat
>-rw-r--r--    1 root root 61244638 Jul 17 01:00 GeoLite2-City.mmdb
>-rw-r--r--    1 root root 20539238 Apr  2  2018 GeoLiteCity.dat
>-rw-r--r--    1 root root  1242574 May  3  2018 GeoLiteCountry.dat


It seems that the URILocalBL still tries to use the old GeoIP database even
though GeoIP2::Database::Reader is installed and working with the RelayCountry
plugin.

-- 
You are receiving this mail because:
You are the assignee for the bug.