1 |
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 |
2 |
--- smeserver-geoip-1.2.old/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-10-20 21:40:40.825000000 -0400 |
3 |
+++ smeserver-geoip-1.2/root/usr/share/qpsmtpd/plugins/check_badcountries 2019-10-20 21:43:24.353000000 -0400 |
4 |
@@ -276,17 +276,14 @@ |
5 |
else { |
6 |
$self->log(LOGNOTICE, "GeoIP City: $city"); |
7 |
} |
8 |
- # Should have a country and or city here |
9 |
+ |
10 |
+ my $country = $self->qp->connection->notes('geoip_country'); |
11 |
+ # Returns DECLINED if there are no countries found above |
12 |
+ return DECLINED unless $country; |
13 |
+ $self->log(LOGNOTICE, "GeoIP Country: $country"); |
14 |
|
15 |
if ( $self->qp->config("badcountries") ) { |
16 |
my @badcountries = $self->qp->config("badcountries"); |
17 |
- |
18 |
- my $country = $self->qp->connection->notes('geoip_country'); |
19 |
- # Returns DECLINED if there are no countries found above |
20 |
- return DECLINED unless $country; |
21 |
- |
22 |
- $self->log(LOGNOTICE, "GeoIP Country: $country"); |
23 |
- |
24 |
for (@badcountries) { |
25 |
my ($pattern, $response) = split /\s+/, $_, 2; |
26 |
#my $whitelisthost = $connection->notes('whitelisthost'); |
27 |
@@ -346,15 +343,13 @@ |
28 |
} |
29 |
$self->log(LOGINFO, join(", ", @msg_parts)); |
30 |
|
31 |
+ my $country = $self->qp->connection->notes('geoip_country'); |
32 |
+ # Returns DECLINED if there are no countries found above |
33 |
+ return DECLINED unless $country; |
34 |
+ $self->log(LOGNOTICE, "GeoIP Country: $country"); |
35 |
+ |
36 |
if ( $self->qp->config("badcountries") ) { |
37 |
my @badcountries = $self->qp->config("badcountries"); |
38 |
- |
39 |
- my $country = $self->qp->connection->notes('geoip_country'); |
40 |
- # Returns DECLINED if there are no countries found above |
41 |
- return DECLINED unless $country; |
42 |
- |
43 |
- $self->log(LOGNOTICE, "GeoIP Country: $country"); |
44 |
- |
45 |
for (@badcountries) { |
46 |
my ($pattern, $response) = split /\s+/, $_, 2; |
47 |
#my $whitelisthost = $connection->notes('whitelisthost'); |