########################################################################
sub see_if_for_local_user_alias {
local $alias;
local $goober;
local $sendto;
local $tag;
local $x;
local $thistag;
# By now it's possible that we've got 2 good indicators of who
# should receive this email, and we've had a shot at rewriting
# the Subject line -- so we'll skip the next bit in that case
# and prepare to deliver this email. "Just in case", though,
# if we don't have 2 indicators by this time, we'll run one
# more check, for 'aliases' of our local receivers.
#
# One question: Are header fields at this point holding -all-
# that was originally in them -- that is, have we truncated
# an enormous long CC: field, for example, so that we've got
# only the first line of it stored? We're not sure -- there's
# been no "live example" to test that out on yet.
$alias = "";
open (ALIASES, "f:/mr2/pollpop/_aliases.lst") or die "eek!";
if (defined ALIASES)
{
while (<ALIASES>)
{
($alias, $goober, $sendto) = split;
foreach $tag ("To:","for","CC:","Cc:","cc:",
"BCC:","Bcc:","bcc:")
{
if ((defined $header{$tag}) &&
(index( $header{$tag}, $alias ) > -1 ))
{
$recipient ++;
if ($tag ne "To:")
{
$thistag = "Was-$tag";
$header{$thistag} = $header{$tag};
}
$header{"Was-To:"} = $header{"To:"};
$header{"To:"} = "$sendto";
print " will deliver to: $sendto\n\n";
unless ($goober eq "''")
{
$header{"Subject:"} =
"($goober) " . $header{"Subject:"};
}
last;
}
if ($recipient > 1) { last; }
}
}
close (ALIASES) or die "eek! -- aliases";
}
} # end of sub see_if_for_local_user_alias