This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlbug reports "Message sent" even when it hasn't
authorTim Bunce (via RT) <perlbug-followup@perl.org>
Wed, 25 Nov 2009 11:02:24 +0000 (03:02 -0800)
committerRafael Garcia-Suarez <rgs@consttype.org>
Thu, 26 Nov 2009 08:42:40 +0000 (09:42 +0100)
perlbug doesn't check the return status of Mail::Send and so reports
"Message sent" even if it hasn't:

utils/perlbug.PL

index 8862a94..c015e25 100644 (file)
@@ -1134,7 +1134,7 @@ sub _send_message_mailsend {
     open(REP, "<$filename") or die "Couldn't open '$filename': $!\n";
     while (<REP>) { print $fh $_ }
     close(REP) or die "Error closing $filename: $!";
-    $fh->close;
+    $fh->close or die "Error sending mail: $!";
 
     print "\nMessage sent.\n";
 }