From df577ff3febb66f53d0ddd59aa3c93e55da5b51a Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Mon, 19 Nov 2012 12:32:21 -0500 Subject: [PATCH] replace all instances of split '' with split // newer versions of perl don't accept split '' syntax any longer --- lib/Qpsmtpd/Address.pm | 4 ++-- lib/Qpsmtpd/Auth.pm | 4 ++-- lib/Qpsmtpd/PollServer.pm | 4 ++-- plugins/helo | 10 ++++++---- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/Qpsmtpd/Address.pm b/lib/Qpsmtpd/Address.pm index 50d008d..5800be2 100644 --- a/lib/Qpsmtpd/Address.pm +++ b/lib/Qpsmtpd/Address.pm @@ -342,8 +342,8 @@ sub _addr_cmp { } #invert the address so we can sort by domain then user - ($left = join( '=', reverse( split('@', $left->format))) ) =~ tr/[<>]//d; - ($right = join( '=', reverse( split('@',$right->format))) ) =~ tr/[<>]//d; + ($left = join( '=', reverse( split(/@/, $left->format))) ) =~ tr/[<>]//d; + ($right = join( '=', reverse( split(/@/,$right->format))) ) =~ tr/[<>]//d; if ( $swap ) { ($right, $left) = ($left, $right); diff --git a/lib/Qpsmtpd/Auth.pm b/lib/Qpsmtpd/Auth.pm index e55a30a..509069c 100644 --- a/lib/Qpsmtpd/Auth.pm +++ b/lib/Qpsmtpd/Auth.pm @@ -144,7 +144,7 @@ sub get_auth_details_cram_md5 { return; }; - my ( $user, $passHash ) = split( ' ', decode_base64($line) ); + my ( $user, $passHash ) = split( / /, decode_base64($line) ); unless ( $user && $passHash ) { $session->respond(504, "Invalid authentication string"); return; @@ -170,7 +170,7 @@ sub validate_password { my ( $self, %a ) = @_; my ($pkg, $file, $line) = caller(); - $file = (split '/', $file)[-1]; # strip off the path + $file = (split /\//, $file)[-1]; # strip off the path my $src_clear = $a{src_clear}; my $src_crypt = $a{src_crypt}; diff --git a/lib/Qpsmtpd/PollServer.pm b/lib/Qpsmtpd/PollServer.pm index 9d91af7..f987c3f 100644 --- a/lib/Qpsmtpd/PollServer.pm +++ b/lib/Qpsmtpd/PollServer.pm @@ -174,12 +174,12 @@ sub start_conversation { my $conn = $self->connection; # set remote_host, remote_ip and remote_port - my ($ip, $port) = split(':', $self->peer_addr_string); + my ($ip, $port) = split(/:/, $self->peer_addr_string); return $self->close() unless $ip; $conn->remote_ip($ip); $conn->remote_port($port); $conn->remote_info("[$ip]"); - my ($lip,$lport) = split(':', $self->local_addr_string); + my ($lip,$lport) = split(/:/, $self->local_addr_string); $conn->local_ip($lip); $conn->local_port($lport); diff --git a/plugins/helo b/plugins/helo index 29a3633..1692b4d 100644 --- a/plugins/helo +++ b/plugins/helo @@ -457,8 +457,8 @@ sub check_ip_match { return; }; - my $dns_net = join('.', (split('\.', $ip))[0,1,2] ); - my $rem_net = join('.', (split('\.', $self->qp->connection->remote_ip))[0,1,2] ); + my $dns_net = join('.', (split(/\./, $ip))[0,1,2] ); + my $rem_net = join('.', (split(/\./, $self->qp->connection->remote_ip))[0,1,2] ); if ( $dns_net eq $rem_net ) { $self->log( LOGNOTICE, "forward network match" ); @@ -470,14 +470,16 @@ sub check_name_match { my $self = shift; my ($dns_name, $helo_name) = @_; + return if ! $dns_name; + if ( $dns_name eq $helo_name ) { $self->log( LOGDEBUG, "reverse name match" ); $self->connection->notes('helo_reverse_match', 1); return; }; - my $dns_dom = join('.', (split('\.', $dns_name ))[-2,-1] ); - my $helo_dom = join('.', (split('\.', $helo_name))[-2,-1] ); + my $dns_dom = join('.', (split(/\./, $dns_name ))[-2,-1] ); + my $helo_dom = join('.', (split(/\./, $helo_name))[-2,-1] ); if ( $dns_dom eq $helo_dom ) { $self->log( LOGNOTICE, "reverse domain match" );