adrenlinerush
New Member
- Messages
- 379
- Reaction score
- 1
- Points
- 0
I've used this same Perl sendmail script on my server at home... various clients of mine servers... etc for years and for some reason its not working on this site... actually it says it executes fine but i never get the messages... I don't know how it would be related other than sendmail permissions but i upgraded to intermediate php which has been done... i've tried both extensions of pl and cgi... still no messages recieved... like i said its the same script i've been using for years on umpteen different servers without change minus the bin path and sendmail path... below is the script for examination along with a sendmail snipit
i really believe its a server setup issue... not sure what sendmail is recieving it but it has worked with true sendmail... ssmtp... msmtp... since i can't look at the logs I can't see whats going on but my first guess would be a relay denied error
<<< Script >>>
#!/usr/bin/perl -wT
use strict;
use CGI;
BEGIN {
$ENV{PATH} = "/bin:/usr/bin";
delete @ENV{ qw( IFS CDPATH ENV BASH_ENV ) };
}
my $q = new CGI;
my $submitaddress = $q->param( "submitaddress" ) ;
my $firstname = $q->param( "firstname" );
my $lastname = $q->param( "lastname" );
my $phone = $q->param( "phone" );
my $email = $q->param( "email" );
my $message =$q->param( "message" );
open MAIL, "| /usr/sbin/sendmail -t -f" or die "Could Not open sendmail: $!";
print MAIL "To: $submitaddress \n";
print MAIL "From: $email \n";
print MAIL "Reply-to: $email \n";
print MAIL "Subject: Message from $lastname, $firstname \n";
print MAIL <<END_OF_MESSAGE;
$firstname $lastname
Phone: $phone
Wrote:
$message
END_OF_MESSAGE
close MAIL;
thank_you();
sub thank_you {
my $timestamp = localtime;
print $q->header( "text/html" ),
$q->start_html( -title => "Thank you" ),
$q->h2( "Thank you for your e-mail" ),
$q->hr,
$q->p( "You sent the message:", $q->b( $message ) ),
$q->p( "You sent your message at:", $q->b( $timestamp ) ),
$q->end_html;
exit;
}
<<html form snipit>>
<FORM ACTION="/cgi-bin/e-mail.cgi" METHOD="POST ENCTYPE="multipart/form-data">
<input type="hidden" name="submitaddress" value="austin@adrenlinerush.net">
<P>
<LABEL for ="firstname">First name: </LABEL>
<INPUT type="text" name="firstname" size="20"><BR>
<LABEL for ="lastname">Last name: </LABEL>
<INPUT type="text" name="lastname" size="20"><BR>
<LABEL for ="phone">Phone#: </LABEL>
<INPUT type="text" name="phone" size="20"><BR>
<LABEL for ="email">E-mail: </LABEL>
<INPUT type="text" name="email" size="20"><BR>
<textarea name="message" name="message" rows="6" cols="50" wrap="soft">
</textarea><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>
i really believe its a server setup issue... not sure what sendmail is recieving it but it has worked with true sendmail... ssmtp... msmtp... since i can't look at the logs I can't see whats going on but my first guess would be a relay denied error
<<< Script >>>
#!/usr/bin/perl -wT
use strict;
use CGI;
BEGIN {
$ENV{PATH} = "/bin:/usr/bin";
delete @ENV{ qw( IFS CDPATH ENV BASH_ENV ) };
}
my $q = new CGI;
my $submitaddress = $q->param( "submitaddress" ) ;
my $firstname = $q->param( "firstname" );
my $lastname = $q->param( "lastname" );
my $phone = $q->param( "phone" );
my $email = $q->param( "email" );
my $message =$q->param( "message" );
open MAIL, "| /usr/sbin/sendmail -t -f" or die "Could Not open sendmail: $!";
print MAIL "To: $submitaddress \n";
print MAIL "From: $email \n";
print MAIL "Reply-to: $email \n";
print MAIL "Subject: Message from $lastname, $firstname \n";
print MAIL <<END_OF_MESSAGE;
$firstname $lastname
Phone: $phone
Wrote:
$message
END_OF_MESSAGE
close MAIL;
thank_you();
sub thank_you {
my $timestamp = localtime;
print $q->header( "text/html" ),
$q->start_html( -title => "Thank you" ),
$q->h2( "Thank you for your e-mail" ),
$q->hr,
$q->p( "You sent the message:", $q->b( $message ) ),
$q->p( "You sent your message at:", $q->b( $timestamp ) ),
$q->end_html;
exit;
}
<<html form snipit>>
<FORM ACTION="/cgi-bin/e-mail.cgi" METHOD="POST ENCTYPE="multipart/form-data">
<input type="hidden" name="submitaddress" value="austin@adrenlinerush.net">
<P>
<LABEL for ="firstname">First name: </LABEL>
<INPUT type="text" name="firstname" size="20"><BR>
<LABEL for ="lastname">Last name: </LABEL>
<INPUT type="text" name="lastname" size="20"><BR>
<LABEL for ="phone">Phone#: </LABEL>
<INPUT type="text" name="phone" size="20"><BR>
<LABEL for ="email">E-mail: </LABEL>
<INPUT type="text" name="email" size="20"><BR>
<textarea name="message" name="message" rows="6" cols="50" wrap="soft">
</textarea><BR>
<INPUT type="submit" value="Send"> <INPUT type="reset">
</P>
</FORM>