X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fsend.pl;h=1ff843859e3d5b17cf800dc0c037dadc6d1fb5b1;hb=7c1e8be08db2526caaa1c1bb7905548841b696e2;hp=2ebca2a93f9a5aaeb7816360d3aa955382ab80d3;hpb=15424b325766c68bc04207c71dbaf86f06ca5ffa;p=spider.git diff --git a/cmd/send.pl b/cmd/send.pl index 2ebca2a9..1ff84385 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") { @@ -49,8 +49,9 @@ if ($self->state eq "prompt") { for ($i++ ; $i < @f; $i++) { my $msgno = DXMsg::next_transno('Msgno'); my $newsubj = "CC: " . $oref->subject; + my $newcall = uc $f[$i]; my $nref = DXMsg->alloc($msgno, - uc $f[$i], + $newcall, $self->call, $main::systime, '1', @@ -68,8 +69,7 @@ if ($self->state eq "prompt") { push @list, $oref->read_msg_body(); $nref->store(\@list); $nref->add_dir(); - #push @out, $self->msg('sendcc', $oref->msgno, $f[$i]); - push @out, "copy of msg $oref->{msgno} sent to $to"; + push @out, $self->msg('m2', $oref->msgno, $newcall); } DXMsg::queue_msg(); return (1, @out); @@ -100,15 +100,34 @@ 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); } else { push @to, $t; } @@ -123,8 +142,7 @@ if ($self->state eq "prompt") { # keep calling me for every line until I relinquish control $self->func("DXMsg::do_send_stuff"); $self->state('send1'); - #push @out, $self->msg('sendsubj'); - push @out, "Enter Subject (30 characters) >"; + push @out, $self->msg('m1'); } return (1, @out);