diff -ruN 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-10 12:26:13.414663660 +0100 +++ smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-01-15 00:30:12.256289214 +0100 @@ -96,6 +96,8 @@ =head1 CHANGES +2019-01 - John Crisp - modify to work correctly with mailstats + 2019-01 - JP Pialasse - make it compatible with old v1 + improve log level 2018-06 - John Crisp - modify to work with SME server @@ -264,11 +266,13 @@ # City Information in case we want to play later my $city = $self->qp->connection->notes('geoip_city') // ''; #warn ("At City (check): $city"); + $self->log(LOGNOTICE, "GeoIP RemoteIP: $ip"); + if ($city eq '') { - $self->log(LOGINFO, "Information: City NA RemoteIP $ip"); + $self->log(LOGNOTICE, "GeoIP City: NA"); } else { - $self->log(LOGINFO, "Information: City $city RemoteIP $ip"); + $self->log(LOGNOTICE, "GeoIP City: $city"); } # Should have a country and or city here @@ -279,15 +283,15 @@ # Returns DECLINED if there are no countries found above return DECLINED unless $country; - $self->log(LOGNOTICE, "Country $country RemoteIP $ip"); + $self->log(LOGNOTICE, "GeoIP Country: $country"); for (@badcountries) { my ($pattern, $response) = split /\s+/, $_, 2; #my $whitelisthost = $connection->notes('whitelisthost'); my $whitelisthost = $self->qp->connection->notes('whitelisthost'); if ($whitelisthost) { - $self->log(LOGINFO, "Country $country Pattern $pattern Whitehost $whitelisthost RemoteIP $ip"); - $self->log(LOGINFO, "Geoip whitelisthost found $whitelisthost"); + $self->log(LOGNOTICE, "Country $country Pattern $pattern Whitehost $whitelisthost RemoteIP $ip"); + $self->log(LOGNOTICE, "Geoip whitelisthost found $whitelisthost"); return OK; } else {