I'm a SME 6.0.1 user
Am trying my best to integrate a few lines of perl that will let me have an email forms handler. No matter what I use as the shebang, I get an Internal Server Error when I submit the data to the script for processing (but it may not be anything to do with the shebang thing).
I have CHMODed the cgi file to 755, its CHOWN values are root:admin (only because I logged in as root to do the integration)
I have a virtual domain linked to an ibay.
I have enabled the cgi-bin facility for the ibay in question, put the email handler script )I called it postit.cgi) in the cgi-bin folder.
The HTML calls up the following action value:
<form action="http://www.mydomain.co.uk/cgi-bin/postit.cgi" method="post" name="MyForm">
...
inputs and submit stuff
</form>
The cgi script looks like this
#!/usr//bin/perl -w
use strict;
use CGI;
my $query = CGI->new();
my @names = $query->param;
my $noemail="";
my $from = $query->param('email');
if ($from eq ""){
$from = "noname\@mydomain.co.uk";
}else{
$from =~ s/@/\@/;
$noemail="true";
}
my $myself = "sales\@mydomain.co.uk";
open (MAIL, "|/usr/sbin/sendmail -t");
print MAIL "To: $myself \nFrom: $from\n";
my $subj = $query->param('subject');
if ($subj eq ""){
print MAIL "Subject: Form info entered\n";
}else{
print MAIL "Subject: " . $subj . "\n";
}
foreach my $name (@names){
my @values = $query->param( $name );
if ((join ", ", @values) && ($name ne "subject") && ($name ne "email")){
print MAIL $name . " = " . (join ", ", @values) . "\n";
}
}
close (MAIL);
print $query->redirect("http://www.mydomain.co.uk/thankyou.html");
Can anyone spot where my problem lies? I've looked through my Apache book but have hit a bit of a dead end. The error message reads:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@tapiochre.co.uk and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
but I see no evidence in the logs to this problem, unless I'm looking in the wring place.
Chris