open($sendmail_fh,'|-','/usr/sbin/sendmail',$q_e->{mailto}) or
die "Unable to open sendmail to send message";
print {$sendmail_fh} $q_e->{email};
- close($sendmail_fh);
- waitpid(-1,0);
- if ($?) {
- print STDERR "Sendmail failed with $?\n";
- exit $?;
- }
+ close($sendmail_fh) or
+ print STDERR "Sendmail failed with $?\n" and
+ exit $?;
unlink("$options{queue}/$options{process}");
}
else {