fix the send command so that only valid TO addresses are allowed.
[spider.git] / perl / DXMsg.pm
index 118feef49dba1bf420ca2172dfb6aa990ed975fc..dbcd8097bafce544231a37f7e58565f55999e3c3 100644 (file)
@@ -1182,6 +1182,32 @@ sub forward_it
        return 0;
 }
 
+#
+# look down the forward table to see whether this is a valid bull
+# or not (ie it will forward somewhere even if it is only here)
+#
+sub valid_bull_addr
+{
+       my $call = shift;
+       my $i;
+       
+       unless (@forward) {
+               return 1 if $call =~ /^ALL/;
+               return 1 if $call =~ /^DX/;
+               return 0;
+       }
+       
+       for ($i = 0; $i < @forward; $i += 5) {
+               my ($sort, $field, $pattern, $action, $bbs) = @forward[$i..($i+4)]; 
+               if ($field eq 'T') {
+                       if (!$pattern || $call =~ m{$pattern}i) {
+                               return 1;
+                       }
+               }
+       }
+       return 0;
+}
+
 sub dump_it
 {
        my $ref = shift;