From 179ce69d2479d950536efd127fe7b11666e4da6e Mon Sep 17 00:00:00 2001 From: minima Date: Thu, 25 Oct 2001 15:46:38 +0000 Subject: [PATCH] added a bit of error checking --- perl/DXMsg.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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'); } } } -- 2.43.0