SA Bugzilla – Bug 7687
Mail::SpamAssassin::Plugin::URILocalBL require Geo::IP
Last modified: 2019-02-04 10:06:02 UTC
Plugin Mail::SpamAssassin::Plugin::URILocalBL require Geo::IP even if GeoIP2::Database::Reader is installed and working. If GeoIP2::Database::Reader is installed and Geo::IP is not installed plugin fails with: Bareword "GEOIP_MEMORY_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 465. Bareword "GEOIP_CHECK_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 465. Bareword "GEOIP_ISP_EDITION" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 466. Bareword "GEOIP_MEMORY_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 466. Bareword "GEOIP_CHECK_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 466. Bareword "GEOIP_MEMORY_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 470. Bareword "GEOIP_CHECK_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 470. Bareword "GEOIP_ISP_EDITION" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 471. Bareword "GEOIP_MEMORY_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 471. Bareword "GEOIP_CHECK_CACHE" not allowed while "strict subs" in use at /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm line 471. Execution of /usr/share/perl5/vendor_perl/Mail/SpamAssassin/Plugin/URILocalBL.pm aborted due to compilation errors. I don't know if this is a bug or not, maybe Geo::IP is still required anyhow. But it cause a little confusion.
"use constant" is evaluated at compile time while if statements at run time, so you cannot create a pseudo code like: if ($condition) { use constant ... } else { use constant ... } I cannot see any easy solution without adding a parameter to URILocalBL config like it has been done for RelayCountry (country_db_type option).
Perhaps just enough to ditch the imports and use $Geo::IP::GEOIP_ISP_EDITION etc.
Created attachment 5641 [details] let it compile if geoip is not present This diff make it compile even if geoip is not installed
(In reply to Giovanni Bechis from comment #3) > Created attachment 5641 [details] > let it compile if geoip is not present > > This diff make it compile even if geoip is not installed Wonderful! This patch works for me!
Fixed in r1852885.