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

Re: [Way OT] perl, CGI, and sendmail



On Sun, Apr 10, 2005 at 09:33:06PM +0000, Stephen Patterson wrote:
> David <dbree@duo-county.com> writes:
> 
> > 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).
> 
> Check your apache error logs,

As configured, they didn't shed much light on the subject - an example:

127.0.0.1 - - [10/Apr/2005:14:25:47 -0500] "POST /cgi-bin/cgi.pl
HTTP/1.1" 500 605 "http://localhost/~dlb/phprec/cgi-tst.html";
"Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.6) Gecko/20050406
Firefox/1.0.2 (Debian package 1.0.2-3)" "-"

This is the standard format that came with the Debian install of apache
in sarge

> and you probably don't want to be using
> sendmail/exim directly (its cranky as hell). The perl module
> Mail::Sender (libmail-sender-perl) makes sending email a cinch.

I'll look into that.  Actually I probably won't be dealing with cgi and
emails.  I'm just trying to learn a bit about it and get familiar with
apache.

FWIW, I just executed the cgi script directly from the command line
followed by an "echo $?" which returned 0.  The mail is in my spool and
Exim again showed no errors.  I'm sorta stumped as to what is going on.

I added a "From: dlb@localhost.localdomain" and the script changed dlb
to dlb.localdomain when I executed it from the command line, just as
when it is executed from apache.  It must be in the Perl handling of the
addresses because this doesn't happen if I pipe an email generated from
the command line into exim.



Reply to: