in reply to Re^3: sendmail close error
in thread sendmail close error

That's what I did:
print MAIL "From: $from\n"; print MAIL "To: $to_ad\n"; print MAIL "Subject: $subject\n\n"; my $stat = print MAIL "$message"; print "Mail Status: $stat\n"; close(MAIL) || warn "Error closing mail: $!"; print "Mail sent.\n";
I got: Mail Status: 1
Mail sent.

But the mail still does not reach my box and the log reports "Error closing mail:"

Replies are listed 'Best First'.
Re^5: sendmail close error
by Marshall (Canon) on Jul 21, 2011 at 21:35 UTC
    Interesting - I was sort of suspecting that because the most common suspect for error (non-existent reader) would cause a SIGPIPE and you'd get different symptoms. I uploaded this code to a Linux box so I could play with it. Your code works fine on that machine verbatim. I haven't been able to come up with a scenario to force this close() error to happen. Sorry - I'm stumped. Maybe your system admin can shed some light on this?