From: cjwatson <> Date: Mon, 23 Jun 2003 18:23:35 +0000 (-0800) Subject: [project @ 2003-06-23 11:23:35 by cjwatson] X-Git-Tag: release/2.6.0~858 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5b296d6c10e21442db973ee676cdf54b47e4a3de;p=debbugs.git [project @ 2003-06-23 11:23:35 by cjwatson] get_addresses() is used in both process and service, and I think I want to use it from the CGI scripts soon. Move it to errorlib. --- diff --git a/scripts/errorlib.in b/scripts/errorlib.in index a5b7a724..3eba877d 100755 --- a/scripts/errorlib.in +++ b/scripts/errorlib.in @@ -1,5 +1,7 @@ # -*- perl -*- -# $Id: errorlib.in,v 1.31 2003/06/10 01:18:59 cjwatson Exp $ +# $Id: errorlib.in,v 1.32 2003/06/23 11:23:35 cjwatson Exp $ + +use Mail::Address; sub F_SETLK { 6; } sub F_WRLCK{ 1; } $flockstruct= 'sslll'; # And there ought to be something for this too. @@ -321,6 +323,12 @@ sub getmailbody { return undef; } +sub get_addresses { + return + map { $_->address() } + map { Mail::Address->parse($_) } @_; +} + sub escapelog { my @log = @_; map { s/^([\01-\07\030])/\030$1/gm } @log; diff --git a/scripts/process.in b/scripts/process.in index 4b4e3e8a..2d31c99d 100755 --- a/scripts/process.in +++ b/scripts/process.in @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $Id: process.in,v 1.71 2003/05/27 02:39:17 cjwatson Exp $ +# $Id: process.in,v 1.72 2003/06/23 11:23:35 cjwatson Exp $ # # Usage: process nn # Temps: incoming/Pnn @@ -8,7 +8,6 @@ use POSIX qw(strftime tzset); $ENV{"TZ"} = 'UTC'; tzset(); -use Mail::Address; use MIME::Parser; $config_path = '/etc/debbugs'; @@ -929,12 +928,6 @@ sub htmllog { close(AP) || &quit("closing db-h/$hash/$ref.log (lh): $!"); } -sub get_addresses { - return - map { $_->address() } - map { Mail::Address->parse($_) } @_; -} - sub stripbccs { my $msg = shift; my $ret = ''; diff --git a/scripts/service.in b/scripts/service.in index c31399c1..52c806a0 100755 --- a/scripts/service.in +++ b/scripts/service.in @@ -1,11 +1,10 @@ #!/usr/bin/perl -# $Id: service.in,v 1.77 2003/06/05 08:26:59 cjwatson Exp $ +# $Id: service.in,v 1.78 2003/06/23 11:23:35 cjwatson Exp $ # ^ more or less ^ # # Usage: service .nn # Temps: incoming/P.nn -use Mail::Address; use File::Copy; use MIME::Parser; @@ -685,12 +684,6 @@ utime(time,time,"db-h"); unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!"); -sub get_addresses { - return - map { $_->address() } - map { Mail::Address->parse($_) } @_; -} - sub sendmailmessage { local ($message,@recips) = @_; $message = "X-Loop: $gMaintainerEmail\n" . $message;