mail script from Callendar book.


W

wexfordpress

I downloaded the html and perl items from chapter 3 of "Perl for Web
Site Management"
and changed addresses etc. The htmls call the perl script and
everything seems to work down to the point where sendmail is accessed.
Sendmail is running on my system. Here are the error messages from the
httpd log:
----------------------
[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
--------------------------------------
The sendmail calls in the perl script are:
-------------------------------
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";
--------------------------------------------------

Both the html and the perl script are owned by root.

All hints are appreciated. Slackware Linux 12.0 and perl ;
This is perl, v5.8.8 built for i486-linux-thread-multi
John Culleton
 
Ad

Advertisements

T

Tad J McClellan

wexfordpress said:
[Wed Nov 26 16:04:37 2008] [error] [client 127.0.0.1] Program mode
requires special privileges, e.g., root or TrustedUser., referer:


You do not have a Perl problem.

You have a sendmail problem ("TrustedUser" is a sendmail term).

Try a newsgroup related to sendmail, such as comp.mail.sendmail.

Both the html and the perl script are owned by root.


Who owns the files is completely irrelevant.

What is relevant is who owns the process that is running the program.

It appears that whatever user your webserver is configured to run as
is not configured as a TrustedUser in sendmail.
 
Ad

Advertisements

J

Jim Gibson

wexfordpress said:
I downloaded the html and perl items from chapter 3 of "Perl for Web
Site Management"
and changed addresses etc. The htmls call the perl script and
everything seems to work down to the point where sendmail is accessed.
Sendmail is running on my system. Here are the error messages from the
httpd log:
----------------------
[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
--------------------------------------
The sendmail calls in the perl script are:
-------------------------------
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";
--------------------------------------------------

Both the html and the perl script are owned by root.

All hints are appreciated. Slackware Linux 12.0 and perl ;
This is perl, v5.8.8 built for i486-linux-thread-multi

Do other CGI scripts work?

Your web server does not run as root. Try setting the ownership of the
html and the cgi script to that of the web server uid. Run the CGI
script from the command-line under that user and see if it works that
way.

Google for the phrase "Program mode requires special privileges"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top