my $head = $msg->head->header_hashref;
if ($head) {
- if ($head->{From}->[0] =~ /wwv/i || $head->{'From '}->[0] =~ /wwv/i) {
+ if ($head->{Subject}->[0] =~ /wwv/i) {
process_wwv($msg);
} elsif ($head->{From}->[0] =~ /rwc\.boulder/i || $head->{'From '}->[0] =~ /rwc\.boulder/i) {
process_solar($msg);
}
if ($state) {
my $l = $_;
+ next if /\bSec\b/i;
$l =~ s/\s*\.?\r?\n$//;
push @out, $l;
}
}
if ($state > 1) {
my $l = $_;
+ next if /\bSec\b/i;
$l =~ s/\r?\n$//;
push @out, $l;
}
open OUT, ">$tmp/$fn" or die "import $tmp/$fn $!";
print OUT map { "$_\n" } @_;
close OUT;
+
+ # Note we do this this way to make the appearance of
+ # the file in /spider/chat_import atomic. Otherwise there
+ # exists the possiblity of race conditions and other nasties
link "$tmp/$fn", "$import/$fn";
unlink "$tmp/$fn";
}