From: minima Date: Thu, 25 Oct 2001 15:46:38 +0000 (+0000) Subject: added a bit of error checking X-Git-Tag: R_1_49~33 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=179ce69d2479d950536efd127fe7b11666e4da6e;p=spider.git added a bit of error checking --- diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index f60b5903..3038b756 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -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'); } } }