]> dxcluster.org Git - spider.git/commitdiff
added a bit of error checking
authorminima <minima>
Thu, 25 Oct 2001 15:46:38 +0000 (15:46 +0000)
committerminima <minima>
Thu, 25 Oct 2001 15:46:38 +0000 (15:46 +0000)
perl/DXMsg.pm

index f60b59038e274f77b6468b85886ab1c998c9a8c0..3038b75638b12308fe18bd01baafd69ff6c2de7e 100644 (file)
@@ -434,11 +434,15 @@ sub notify
                        my $msg = new Mail::Send Subject=>"[DXSpider: $ref->{from}] $ref->{subject}";
                        $msg->to(@list);
                        my $fh = $msg->open;
-                       print $fh "From: $ref->{from} To: $to On Node: $main::mycall Origin: $ref->{origin} Msgno: $ref->{msgno}\r\n\r\n";
-                       print $fh map {"$_\r\n"} $ref->read_msg_body;
-                       $fh->close;
-                       for (@list) {
-                               Log('msg', "Msgno $ref->{msgno} from $ref->{from} emailed to $_");
+                       if ($fh) {
+                               print $fh "From: $ref->{from} To: $to On Node: $main::mycall Origin: $ref->{origin} Msgno: $ref->{msgno}\r\n\r\n";
+                               print $fh map {"$_\r\n"} $ref->read_msg_body;
+                               $fh->close;
+                               for (@list) {
+                                       Log('msg', "Msgno $ref->{msgno} from $ref->{from} emailed to $_");
+                               }
+                       } else {
+                               dbg("email forwarding error $!") if isdbg('msg'); 
                        }
                }
        }