]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2003-06-23 11:23:35 by cjwatson]
authorcjwatson <>
Mon, 23 Jun 2003 18:23:35 +0000 (10:23 -0800)
committercjwatson <>
Mon, 23 Jun 2003 18:23:35 +0000 (10:23 -0800)
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.

scripts/errorlib.in
scripts/process.in
scripts/service.in

index a5b7a724f29e95142af42e8d40e43ff0cb83e441..3eba877ddf41296488c9684c1d203eadcca4e482 100755 (executable)
@@ -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;
index 4b4e3e8ab3c3d9ea6cbb6fca73f74d87a654e256..2d31c99d891cfbeebf29af5247f388253035444e 100755 (executable)
@@ -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 = '';
index c31399c1d2d19ac49c3832d973e6c3e82b347b72..52c806a01ba2382909cfe70bec7dc8f5c6992b09 100755 (executable)
@@ -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 <code>.nn
 # Temps:  incoming/P<code>.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;