added baddx and badmsg functionality
[spider.git] / cmd / send.pl
index 9717c3afa3e4b578cc8bbde8858f17cb28edf812..2ebca2a93f9a5aaeb7816360d3aa955382ab80d3 100644 (file)
@@ -102,8 +102,22 @@ if ($self->state eq "prompt") {
        }
   
        # now save all the 'to' callsigns for later
-       my @to = map {uc $_} @f[ $i..$#f ];
-       $loc->{to} = \@to;
+       # first check the 'to' addresses for 'badness'
+    my $t;
+       my @to;
+       foreach  $t (@f[ $i..$#f ]) {
+               $t = uc $t;
+               if (grep $_ eq $t, @DXMsg::badmsg) {
+                       push @out, "Sorry, $t is an unacceptable TO address";
+               } else {
+                       push @to, $t;
+               }
+       }
+       if (@to) {
+               $loc->{to} = \@to;
+       } else {
+               return (1, @out);
+       }
 
        # find me and set the state and the function on my state variable to
        # keep calling me for every line until I relinquish control