Re: sendmail not working...

by "The Web Center" <admin(at)webctr.com>

 Date:  Sun, 18 Jun 2000 13:25:51 -0400
 To:  "Lyle" <Lyle(at)lcrcomputer.com>,
<hwg-servers(at)hwg.org>
 References:  lcrcomputer
  todo: View Thread, Original
Sorry...sent early...here's the pipe:

$server="/usr/lib/sendmail -t";

 open (MAIL , "|$server");
 print MAIL $mail;
 close MAIL;


----- Original Message -----
From: Lyle <Lyle(at)lcrcomputer.com>
To: 'The Web Center' <admin(at)webctr.com>; <hwg-servers(at)hwg.org>
Sent: Sunday, June 18, 2000 8:15 AM
Subject: RE: sendmail not working...


This sample script was written and published in a book, so I was assuming
that it works and I have something configured wrong in sendmail or that
'nobody' does not have rights, but the error message that is returned seems
incomplete.  The script was suspossed just parse the form data into a more
readable format and the script was to pass the headers that sendmail needs.
I have been reading up on Sendmail and I don't see the format that sendmail
requires either, so if that part of the script is broke, I wouldn't know it.

I did find one minor DNS problem using sendmail, but that was easily fixed.

-----Original Message-----
From: The Web Center [mailto:admin(at)webctr.com]
Sent: Sunday, June 18, 2000 5:29 AM
To: Lyle
Subject: Re: sendmail not working...


I don't understand this...you can't guarantee that the email headers are in
proper order this way, can you?  Seems to me y
ou might want to handle the incoming data before calling the mail program,
parse it and check for errors, and then worry about printing it out...:)

D

----- Original Message -----
From: Lyle <Lyle(at)lcrcomputer.com>
To: Hwg-Servers List (E-mail) <hwg-servers(at)hwg.org>
Cc: Cindi_lcr <Cindi(at)lcrcomputer.com>
Sent: Saturday, June 17, 2000 11:36 PM
Subject: sendmail not working...


I had forgotten that sendmail wasn't working on my linux/apache server.  Now
I need to get it working...

I have sendmail working from the command line (sendmail -v
lyle(at)lcrcomputer.com < test.msg), but when I try from a .cgi script, it
fails with a partial error message from Apache

malformed header from script. Bad header=nobody... Recipents must:

That's it.  The rest of the line after is just the address of the .cgi
script.  Any ideas?  Or is it a permissions problem as Apache is running as
nobody?

Here's the .cgi script I am using(from the book Effective Web Design):

#!/usr/bin/perl
# enter the email adrss the data should be sent to
# don't forget to use the format name\(at)company.com

# Next edit the subject line appropriately

# Edit the return variable to hold the URL for the page you want
# your visitor to go to next

# Title is the name of the page they'll go to

# Ask your system administrator for the 'the path to sendmil' on your system
# edit below if necessary

# --- edit only these variables.  Do not remove quotes ---#

$email = "lyle\(at)lcrcomputer.com";

$subject = "Form Responses";

$return = "http://www.keefeagency.com/class/lgiese_sent.html";

$title = "Class assignment";

$sendmail = "/usr/sbin/sendmail -t";

# ----- do not edit below this line --------------#

read(STDIN, $data, $env{'CONTENT_LENGTH'});
open (mailout, "| $sendmail") ||die "Error, where's your sendmail?";
@response = split(/&/,$data);
foreach (@response) {
tr/+/ /;
s/=/ = /;
s/%(..)/pack("C",hex($1))/ge;
print mailout "$_\n";
}
close(mailout);
print "Content-type: text/html\n\n";
print "<HTML><HEAD>\n";
print "<TITLE>Form Sent!</TITLE>\n";
print "</HEAD><BODY>\n";
print "<H3>Form Sent!</H3>\n";
print "<P>Follow this link to <A href=\"$return\">$title;</a>.\n";
print "</body>\n</html>\n";
#end

HWG: hwg-servers mailing list archives, maintained by Webmasters @ IWA