You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2019/06/09 13:13:59 UTC
svn commit: r1860903 -
/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm
Author: hege
Date: Sun Jun 9 13:13:59 2019
New Revision: 1860903
URL: http://svn.apache.org/viewvc?rev=1860903&view=rev
Log:
Bug 7037 - RelayCountry is leaking file descriptors
Modified:
spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm
Modified: spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm?rev=1860903&r1=1860902&r2=1860903&view=diff
==============================================================================
--- spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm (original)
+++ spamassassin/branches/3.4/lib/Mail/SpamAssassin/Plugin/RelayCountry.pm Sun Jun 9 13:13:59 2019
@@ -51,11 +51,6 @@ use re 'taint';
our @ISA = qw(Mail::SpamAssassin::Plugin);
-my $db;
-my $dbv6;
-my $db_info; # will hold database info
-my $db_type; # will hold database type
-
# constructor: register the eval rule
sub new {
my $class = shift;
@@ -166,6 +161,11 @@ If not defined, GeoIP2 default search in
sub extract_metadata {
my ($self, $opts) = @_;
+ my $db;
+ my $dbv6;
+ my $db_info; # will hold database info
+ my $db_type; # will hold database type
+
my $country_db_type = $opts->{conf}->{country_db_type};
my $country_db_path = $opts->{conf}->{country_db_path};
@@ -322,10 +322,10 @@ sub extract_metadata {
sub parsed_metadata {
my ($self, $opts) = @_;
- return 1 unless $db;
-
my $countries =
$opts->{permsgstatus}->get_message->get_metadata('X-Relay-Countries');
+ return 1 if !defined $countries;
+
my @c_list = split(' ', $countries);
$opts->{permsgstatus}->set_tag("RELAYCOUNTRY",
@c_list == 1 ? $c_list[0] : \@c_list);