Bug 7079 - URILocalBL.pm emits warnings to stderr if GeoIP datafile(s) missing
Summary: URILocalBL.pm emits warnings to stderr if GeoIP datafile(s) missing
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: All All
: P2 minor
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-29 23:19 UTC by Philip Prindeville
Modified: 2014-09-04 20:06 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Redirect stderr to /dev/null momentarily patch None Philip Prindeville [HasCLA]
Better fix patch None Philip Prindeville [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Prindeville 2014-08-29 23:19:57 UTC
Created attachment 5233 [details]
Redirect stderr to /dev/null momentarily

This was introduced in bug #7060.

Problem is that libGeoIP writes to stderr, even though it's a library and return codes should be adequate for indicating errors.

Bug has been filed with MaxMind.com (the authors of libGeoIP, which is used in the CPAN module Geo::IP which we use).

In the meantime, here's a workaround for version 1.5.1 and earlier.
Comment 1 Kevin A. McGrail 2014-09-01 18:51:16 UTC
Thanks Philip,

svn commit -m 'Bug 7079 to hide the Geo::IP warning'
Sending        lib/Mail/SpamAssassin/Plugin/URILocalBL.pm
Transmitting file data .
Committed revision 1621867.
Comment 2 Philip Prindeville 2014-09-04 19:10:53 UTC
Note that this has been fixed upstream in geoip-api-c version 1.44 and geoip-api-perl (Geo::IP) version 1.6.3 (both unreleased at this time).
Comment 3 Kevin A. McGrail 2014-09-04 19:14:59 UTC
(In reply to Philip Prindeville from comment #2)
> Note that this has been fixed upstream in geoip-api-c version 1.44 and
> geoip-api-perl (Geo::IP) version 1.6.3 (both unreleased at this time).

Thanks Philip!
Comment 4 Philip Prindeville 2014-09-04 19:16:26 UTC
Created attachment 5234 [details]
Better fix

This patch detects whether Geo::IP exports the symbol GEOIP_SILENCE. If it does, then the underlying XS stubs automatically set that flag when calling into the C API's GeoIP_open() or GeoIP_new()... and hence don't exhibit the broken behavior.
Comment 5 Kevin A. McGrail 2014-09-04 20:06:17 UTC
Thanks and committed.

svn commit -m 'better patch for GeoIP warning- bug 7079'
Sending        lib/Mail/SpamAssassin/Plugin/URILocalBL.pm
Transmitting file data .
Committed revision 1622551.