Perl Sendmail Problem -- sendmail config

Status
Not open for further replies.

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>
 

DefecTalisman

Community Advocate
Community Support
Messages
4,148
Reaction score
5
Points
38
Uhm I know a little perl.
Are those mail headers suposed to be html ? If so they are formated incorrect :

To : whome ever < whome_ever@mail.com >

Also I have to ask, have you tried checking they aren't getting filtered as spam or being sent to junk mail box ?
 

adrenlinerush

New Member
Messages
379
Reaction score
1
Points
0
yes ... the email its going to has no filter ... its wide open and set to always accept... i won't lock it down until i know its working...

actually i know mine is correct as well as yours... like i said this has been up and running for about 5 years on various different servers....
Edit:
anybody with shell access please take a look at the sendmail logs and let me know whats up...
Edit:
some help would be much appreciated
Edit:
Bump ... someone with shell access could you at least get me the sendmail logs so that i can review?
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Have you considered using sendmail.pm ?

I don't believe you have direct access to pipe to sendmail on a free host like this, would lead to too much mail abuse :p
 

adrenlinerush

New Member
Messages
379
Reaction score
1
Points
0
that could be very possible, but why am i not dieing then when i pipe to it?
it seems that its receiving it and accepting it but essentially just then throwing it away

could you verify that that is the case?
also does paid hosting allow that access?

I will check into the sendmail.pm... I was just trying to re-use old code... like i said i've been using that html snipit in conjuction with that script for several years on my sites I've hosted at home and for clients on their purchased webspace on own servers....

thank you for the reply
 
Status
Not open for further replies.
Top