[Mailagent-svn] SF.net SVN: mailagent: [3] trunk/mailagent
Brought to you by:
rmanfredi
From: <rma...@us...> - 2008-01-17 10:03:21
|
Revision: 3 http://mailagent.svn.sourceforge.net/mailagent/?rev=3&view=rev Author: rmanfredi Date: 2008-01-17 01:58:33 -0800 (Thu, 17 Jan 2008) Log Message: ----------- Removed use of $* which is no longer supported by perl 5.10. Modified Paths: -------------- trunk/mailagent/agent/pl/actions.pl trunk/mailagent/agent/pl/analyze.pl trunk/mailagent/agent/pl/matching.pl trunk/mailagent/agent/pl/parse.pl trunk/mailagent/agent/pl/q.pl trunk/mailagent/agent/pl/read_conf.pl trunk/mailagent/bin/perload Modified: trunk/mailagent/agent/pl/actions.pl =================================================================== --- trunk/mailagent/agent/pl/actions.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/actions.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -863,6 +863,7 @@ /^Return-Receipt-To:/i || # Sendmail's acknowledgment /^Received:/i || # We want to remove received /^Precedence:/i || + /^X-Complaints-To:/i || # INN2 does not like this field /^Errors-To:/i # Error report redirection ) { $last_was_header = 1; # Mark we discarded the line @@ -1628,6 +1629,9 @@ &add_log("WARNING cannot chdir to $cf'home: $!") if $loglvl > 5; } + $script =~ s/^\s*~/$cf'home/; # ~ substitution + $script =~ s/\b~/$cf'home/g; # ~ substitution as first letter in word + # Set up the @ARGV array, by parsing the $script variable with &shellwords. # Note that the @ARGV array is held in the main package, but since the # mailagent makes no use of it at this point, there is no need to save its Modified: trunk/mailagent/agent/pl/analyze.pl =================================================================== --- trunk/mailagent/agent/pl/analyze.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/analyze.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -108,15 +108,12 @@ local(@filter) = split(/\n/, $header); # Look for each X-Filter local($address) = &email_addr; # Our e-mail address local($done) = 0; # Already processed ? - local($*) = 0; local($_); foreach (@filter) { # Maybe we'll find ourselves if (/mailagent.*for (\S+)/) { # Mark left by us ? $done = 1 if $1 eq $address; # Yes, we did that - $* = 1; # Remove that X-Filter line, LEAVE will add one anyway - $Header{'Head'} =~ s/^X-Filter:\s*mailagent.*for $address\n//; - $* = 0; + $Header{'Head'} =~ s/^X-Filter:\s*mailagent.*for $address\n//m; last; } } Modified: trunk/mailagent/agent/pl/matching.pl =================================================================== --- trunk/mailagent/agent/pl/matching.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/matching.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -363,15 +363,14 @@ } else { $buffer = $Header{$selector}; } - $* = 1; # Multi-line matching is attempted - @matched = eval '($buffer =~ ' . $pattern . ');'; + # Ensure multi-line matching by adding trailing "m" option to pattern + @matched = eval '($buffer =~ ' . $pattern . 'm);'; # If buffer is empty, we have to recheck the pattern in a non array context # to see if there is a match. Otherwise, /(.*)/ does not seem to match an # empty string as it returns an empty string in $matched[0]... - $matched[0] = eval '$buffer =~ ' . $pattern if $buffer eq ''; + $matched[0] = eval '$buffer =~ ' . $pattern . 'm' if $buffer eq ''; &eval_error; # Make sure eval worked &update_backref(*matched); # Record non-null backreferences - $* = 0; $matched[0]; # Return matching status } Modified: trunk/mailagent/agent/pl/parse.pl =================================================================== --- trunk/mailagent/agent/pl/parse.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/parse.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -232,12 +232,10 @@ # There is usually one Apparently-To line per address. Remove all new lines # in the header line and replace them with ','. Likewise for To: and Cc:. # although it is far less likely to occur. - local($*) = 1; foreach $field ('Apparently-To', 'To', 'Cc') { - $Header{$field} =~ s/\n/,/g; # Remove new-lines - $Header{$field} =~ s/,$/\n/; # Restore last new-line + $Header{$field} =~ s/\n/,/gm; # Remove new-lines + $Header{$field} =~ s/,$/\n/m; # Restore last new-line } - $* = 0; # If no To: field, then maybe there is an Apparently-To: instead. If so, # make them identical. Otherwise, assume the mail was directed to the user. Modified: trunk/mailagent/agent/pl/q.pl =================================================================== --- trunk/mailagent/agent/pl/q.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/q.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -15,8 +15,7 @@ # Quotation removal routine sub q { local($_) = @_; - local($*) = 1; - s/^://g; + s/^://gm; $_; } Modified: trunk/mailagent/agent/pl/read_conf.pl =================================================================== --- trunk/mailagent/agent/pl/read_conf.pl 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/agent/pl/read_conf.pl 2008-01-17 09:58:33 UTC (rev 3) @@ -111,13 +111,12 @@ if ($@ ne '') { # Parsing error detected local($error) = $@; # Logged error - local($*) = 1; $error = (split(/\n/, $error))[0]; # Keep only first line # Dump error message on stderr, as well as faulty configuration file. # The original is restored out of the perl form to avoid surprise. - $eval =~ s/^\$.* =~ s\|~\|.*\n//g; # Remove added ~ substitutions - $eval =~ s/^\$//g; # Remove leading '$' - $eval =~ s/ = "(.*)";/: $1/g; # Keep only variable value + $eval =~ s/^\$.* =~ s\|~\|.*\n//gm; # Remove added ~ substitutions + $eval =~ s/^\$//gm; # Remove leading '$' + $eval =~ s/ = "(.*)";/: $1/gm; # Keep only variable value chop($eval); print STDERR <<EOM; **** Syntax error in configuration: Modified: trunk/mailagent/bin/perload =================================================================== --- trunk/mailagent/bin/perload 2006-11-04 11:46:52 UTC (rev 2) +++ trunk/mailagent/bin/perload 2008-01-17 09:58:33 UTC (rev 3) @@ -273,8 +273,7 @@ : unless seek(main'DATA, $pos, 0); : local($/) = "\n}"; : local($body) = scalar(<main'DATA>); -: local($*) = 1; -: die "End of file found while loading $_[0].\n" unless $body =~ /^\}$/; +: die "End of file found while loading $_[0].\n" unless $body =~ /^\}$/m; EOC if ($opt_t) { print &q(<<'EOC'); @@ -460,8 +459,7 @@ sub q { local($_) = @_; - local($*) = 1; - s/^://g; + s/^://gm; $_; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |