Can't get to sendmail from standard script.

34 views
Skip to first unread message

wexfordpress

unread,
Nov 26, 2008, 4:33:00 PM11/26/08
to Perl Mail::Sendmail
I am using a published html and CGI perl script combination from
chapter 3 of John Callendar's
"Perl for web site management." The job blows up in the perl script,
probably near here:
----------------------------------
open MAIL, "|$sendmail -oi -t" or die "Can't open pipe to $sendmail: $!
\n";

print MAIL <<"EOF";
To: $recipient
From: $sender
Subject: Sample Web Form Submission

$mail_body
EOF

close MAIL or die "Can't close pipe to $sendmail: $!\n";
------------------------------
The open doesn't generate a perl error message but the close does:
-------------------------------------------------
[Wed Nov 26 16:04:37 2008] [error] [client 127.0.0.1] Program mode
requires special privileges, e.g., root or TrustedUser., referer:
http://hda2/ex_0301.html
[Wed Nov 26 16:04:37 2008] [error] [client 127.0.0.1] Can't close pipe
to /usr/sbin/sendmail: Broken pipe, referer: http://hda2/ex_0301.html
[Wed Nov 26 16:04:37 2008] [error] [client 127.0.0.1] Premature end of
script headers: mail_form.plx, referer: http://hda2/ex_0301.html
------------------------------------------------

All comments appreciated.

John Culleton

Felipe Gasper

unread,
Nov 27, 2008, 10:11:58 PM11/27/08
to Perl-Mai...@googlegroups.com
Personally, I would suggest using the Mail::Sendmail module, which
removes the dependency on the sendmail executable.
Reply all
Reply to author
Forward
0 new messages