[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Way OT] perl, CGI, and sendmail



I know this ain't Debian but I've racked my brain on this.

Been experimenting with CGI, using perl.  I have a form that generates
the needed variables, etc.

I have it to where when I submit the data, the mail is sent and I
receive it (FWIW, using exim4), Exim doesn't report any errors, but I
get a 500 error (Internal Server Error) from apache (1.3.33-4).

I can edit the file by comenting out the SENDMAIL references and
substituting HTML tags, (leaving in the "use" statements), and the page
is sent with no errors reported (200 code).

Unless there's some bug in the perl code, I have some non-fatal error in
my script and perl is returning an error, but I certainly am stumped.

I've checked that the HERE-TAG (end_html) is on a line by itself, and
can't find anything else, but I bet it's there.

One other quirk I've found with the Perl sending is that if I have a To
or From header, any of these addresses are changed to
dlb.localhost@localhost.localdomain (should be just dlb@...).

I can compose an email on the command line with a "From" header and pipe
it through exim and it goes correctly.

Sorry about the OT stuff but I'd just like to know.

#! /usr/bin/perl

require("CGI.pm");

# Load CGI.pm library to handle input and objects
use CGI qw(:standard :cgi-lib);
use CGI::Carp qw(fatalsToBrowser);

# parse form variables to array
&ReadParse;

# print return html header

open(SENDMAIL, "| /usr/sbin/sendmail dlb");
print SENDMAIL <<"end_html";
Subject: CGI Perl Test

--------------------8<------------------
Generated by NEW cgi.pl
-----------------------------------------

You entered the name $in{'myname'}
You entered $in{'city'} for a city

              Sincerely yours,<
			  Perl-user

end_html


Reply to: