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.
# -*- 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.
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;
#!/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
$ENV{"TZ"} = 'UTC';
tzset();
-use Mail::Address;
use MIME::Parser;
$config_path = '/etc/debbugs';
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 = '';
#!/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;
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;