diff -Nur smeserver-geoip-1.2.old/root/usr/share/qpsmtpd/plugins/check_badcountries smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries --- smeserver-geoip-1.2.old/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-01-05 14:42:43.487000000 -0500 +++ smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-01-05 14:47:37.767000000 -0500 @@ -96,6 +96,8 @@ =head1 CHANGES +2019-01 - JP Pialasse - make it compatible with old v1 + improve log level + 2018-06 - John Crisp - modify to work with SME server 2014-06 - Matt Simerson - added GeoIP2 support @@ -152,9 +154,8 @@ sub load_geoip { my ( $self ) = @_; - # prevent v1 from functioning - # $self->load_geoip1() and return 1; $self->load_geoip2() and return 1; + $self->load_geoip1() and return 1; #only search v1 if v2 not available return 0; } @@ -278,7 +279,7 @@ # Returns DECLINED if there are no countries found above return DECLINED unless $country; - $self->log(LOGINFO, "Country $country RemoteIP $ip"); + $self->log(LOGNOTICE, "Country $country RemoteIP $ip"); for (@badcountries) { my ($pattern, $response) = split /\s+/, $_, 2; @@ -476,6 +477,7 @@ return $self->set_asn_ipv6($ip); } return if ! $self->{GeoIPASNum}; + return if ! $self->{GeoIPASNum}->can('name_by_addr');# prior Geo-IP 1.39 should use org_by_addr my $asn = $self->{GeoIPASNum}->name_by_addr($ip) or return; if ('AS' eq substr($asn, 0, 2)) {