X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fsend.pl;h=14913eab1afa6ada93f30ebe18f3242dc3782ed7;hb=6a0a8992abe3599aea8e2fc60f93906618852de7;hp=ade1dce0aca7e3789e8f3d1daf4eb88ba7addb92;hpb=f0ac8322367c66080b6dbb74da4de72dae126dc3;p=spider.git diff --git a/cmd/send.pl b/cmd/send.pl index ade1dce0..14913eab 100644 --- a/cmd/send.pl +++ b/cmd/send.pl @@ -20,7 +20,7 @@ my ($self, $line) = @_; my @out; my $loc; -#$DB::single = 1; +# $DB::single = 1; if ($self->state eq "prompt") { @@ -100,13 +100,32 @@ if ($self->state eq "prompt") { delete $self->{loc}; return (1, $self->msg('e6')); } - + # now save all the 'to' callsigns for later # first check the 'to' addresses for 'badness' my $t; my @to; - foreach $t (@f[ $i..$#f ]) { + splice @f, 0, $i-1 if $i > 0; + foreach $t (@f) { $t = uc $t; + + # is this callsign a distro? + my $fn = "/spider/msg/distro/$t.pl"; + if (-e $fn) { + my $fh = new IO::File $fn; + if ($fh) { + local $/ = undef; + my $s = <$fh>; + $fh->close; + my @call; + @call = eval $s; + return (1, "Error in Distro $t.pl:", $@) if $@; + if (@call > 0) { + push @f, @call; + next; + } + } + } if (grep $_ eq $t, @DXMsg::badmsg) { # push @out, "Sorry, $t is an unacceptable TO address"; push @out, $self->msg('m3', $t);