From 4a745d6baf05151774458358b9064322d42e1bd7 Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 20 Nov 2012 01:40:57 -0500 Subject: [PATCH] updated more split '' syntax to split // --- lib/Qpsmtpd.pm | 2 +- lib/Qpsmtpd/Postfix/pf2qp.pl | 2 +- log/summarize | 4 ++-- plugins/auth/auth_flat_file | 2 +- plugins/auth/auth_vpopmail | 2 +- plugins/auth/auth_vpopmail_sql | 2 +- plugins/dspam | 18 ++++++++++-------- plugins/hosts_allow | 2 +- plugins/rcpt_map | 2 +- 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index b7a9932..133a6a8 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -354,7 +354,7 @@ sub _load_plugin { my $self = shift; my ($plugin_line, @plugin_dirs) = @_; - my ($plugin, @args) = split ' ', $plugin_line; + my ($plugin, @args) = split / /, $plugin_line; my $package; diff --git a/lib/Qpsmtpd/Postfix/pf2qp.pl b/lib/Qpsmtpd/Postfix/pf2qp.pl index 0cd7894..3f8f55d 100755 --- a/lib/Qpsmtpd/Postfix/pf2qp.pl +++ b/lib/Qpsmtpd/Postfix/pf2qp.pl @@ -67,7 +67,7 @@ while () { next if /^_/; s#(/\*.*\*/)##; my $comment = $1 || ""; - my @words = split ' ', $_; + my @words = split / /, $_; my $const = shift @words; if ($const eq "CLEANUP_STAT_OK") { push @out, ""; diff --git a/log/summarize b/log/summarize index b203cca..b14dd3f 100755 --- a/log/summarize +++ b/log/summarize @@ -195,7 +195,7 @@ sub parse_line_plugin { my ($tai, $pid, $hook, $plugin, $message ) = split /\s/, $line, 5; $plugin =~ s/:$//; if ( $plugin =~ /_3a/ ) { - ($plugin) = split '_3a', $plugin; # trim :N off the plugin log entry + ($plugin) = split /_3a/, $plugin; # trim :N off the plugin log entry }; $plugin =~ s/_2d/-/g; @@ -320,7 +320,7 @@ sub populate_plugins_from_registry { next if ! $aliases; $aliases =~ s/\s+//g; $plugins{$name}{aliases} = $aliases; - foreach my $a ( split ',', $aliases ) { + foreach my $a ( split /,/, $aliases ) { $plugin_aliases{$a} = $name; }; }; diff --git a/plugins/auth/auth_flat_file b/plugins/auth/auth_flat_file index a17d051..2045009 100644 --- a/plugins/auth/auth_flat_file +++ b/plugins/auth/auth_flat_file @@ -53,7 +53,7 @@ sub auth_flat_file { return ( DENY, "authflat - missing password" ); } - my ( $pw_name, $pw_domain ) = split '@', lc($user); + my ( $pw_name, $pw_domain ) = split /@/, lc($user); unless ( defined $pw_domain ) { $self->log(LOGINFO, "fail: missing domain"); diff --git a/plugins/auth/auth_vpopmail b/plugins/auth/auth_vpopmail index 91a5ac6..e1dc423 100644 --- a/plugins/auth/auth_vpopmail +++ b/plugins/auth/auth_vpopmail @@ -61,7 +61,7 @@ sub auth_vpopmail { my ($self, $transaction, $method, $user, $passClear, $passHash, $ticket) = @_; - my $pw = vauth_getpw( split '@', lc($user) ); + my $pw = vauth_getpw( split /@/, lc($user) ); my $pw_clear_passwd = $pw->{pw_clear_passwd}; my $pw_passwd = $pw->{pw_passwd}; diff --git a/plugins/auth/auth_vpopmail_sql b/plugins/auth/auth_vpopmail_sql index dd9b3cb..90f08e8 100644 --- a/plugins/auth/auth_vpopmail_sql +++ b/plugins/auth/auth_vpopmail_sql @@ -104,7 +104,7 @@ sub get_db_handle { sub get_vpopmail_user { my ( $self, $dbh, $user ) = @_; - my ( $pw_name, $pw_domain ) = split '@', lc($user); + my ( $pw_name, $pw_domain ) = split /@/, lc($user); if ( ! defined $pw_domain ) { $self->log(LOGINFO, "skip: missing domain: " . lc $user ); diff --git a/plugins/dspam b/plugins/dspam index 9f36032..6812451 100644 --- a/plugins/dspam +++ b/plugins/dspam @@ -260,7 +260,7 @@ sub select_username { $self->log(LOGDEBUG, "Message has $recipient_count recipients"); if ( $recipient_count > 1 ) { - $self->log(LOGINFO, "skipping user prefs, $recipient_count recipients detected."); + $self->log(LOGINFO, "multiple recipients ($recipient_count), ignoring user prefs"); return getpwuid($>); }; @@ -296,13 +296,13 @@ sub parse_response { #return $self->parse_response_regexp( $response ); # probably slower - my ($user, $result, $class, $prob, $conf, $sig) = split '; ', $response; + my ($user, $result, $class, $prob, $conf, $sig) = split /; /, $response; - (undef, $result) = split '=', $result; - (undef, $class ) = split '=', $class; - (undef, $prob ) = split '=', $prob; - (undef, $conf ) = split '=', $conf; - (undef, $sig ) = split '=', $sig; + (undef, $result) = split /=/, $result; + (undef, $class ) = split /=/, $class; + (undef, $prob ) = split /=/, $prob; + (undef, $conf ) = split /=/, $conf; + (undef, $sig ) = split /=/, $sig; $result = substr($result, 1, -1); # strip off quotes $class = substr($class, 1, -1); @@ -656,7 +656,9 @@ sub autolearn_spamassassin { my $sa = $transaction->notes('spamassassin' ); if ( ! $sa || ! $sa->{is_spam} ) { - $self->log(LOGERROR, "SA results missing"); + if ( ! $self->connection->notes('naughty') ) { + $self->log(LOGERROR, "SA results missing"); # SA skips naughty + }; return; }; diff --git a/plugins/hosts_allow b/plugins/hosts_allow index 550504c..6661ec1 100644 --- a/plugins/hosts_allow +++ b/plugins/hosts_allow @@ -98,7 +98,7 @@ sub in_hosts_allow { my ($ipmask, $const, $message) = split /\s+/, $_, 3; next unless defined $const; - my ($net,$mask) = split '/', $ipmask, 2; + my ($net,$mask) = split /\//, $ipmask, 2; $mask = 32 if ! defined $mask; $mask = pack "B32", "1"x($mask)."0"x(32-$mask); if (join('.', unpack('C4', inet_aton($remote) & $mask)) eq $net) { diff --git a/plugins/rcpt_map b/plugins/rcpt_map index 32c0a3b..e18d168 100644 --- a/plugins/rcpt_map +++ b/plugins/rcpt_map @@ -153,7 +153,7 @@ sub read_map { s/^\s*//; next if /^#/; next unless $_; - my ($addr, $code, $msg) = split ' ', $_, 3; + my ($addr, $code, $msg) = split / /, $_, 3; next unless $addr; unless ($code) {