• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

qmail-inject not working for users?

D

devindull

Guest
We have a form mailer script and it originally was made to use sendmail, however since sendmail isn't a smart venture, we tried qmail-inject. The script is a working script, it's worked on many other servers with sendmail, although they haven't had Plesk installed.

After submitting the form (POST formmail.cgi) the server reponds saying:

Method Not Allowed
The requested method POST is not allowed for the URL /mailer/formmail.cgi.
--------------------------------------------------------------------------------
Apache/1.3.33 Server at www.tommywho.com Port 80

Here's the script we use:
#!/usr/bin/perl

$mailpath='/usr/local/psa/qmail/bin/qmail-inject*';
$address='[email protected]';

print "Location: http://www.tommywho.com/index.php\n\n";
print "Content-type:text/html\n\n";

if ($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
$input=$buffer;
$input=~ s/&/\n/g;
$input=~ tr/+/ /;
$input=~ s/%([\da-f]{1,2})/pack(C,hex($1))/eig;

open (MAIL, "|$mailpath -t")or die ("wrong mailprog\n");
print MAIL "To: $address\n";
print MAIL "From: LT Site Question\n";
print MAIL "Subject: Question from LT website\n";
print MAIL "$input\n";
print MAIL "\n\n";
print MAIL "HTTP-FROM: $ENV{'HTTP_FROM'}\n";
print MAIL "REMOTE-HOST: $ENV{'REMOTE_HOST'}\n";
print MAIL "FROM IP NUMBER: $ENV{'REMOTE_ADDR'}\n";
close (MAIL);
}


Any ideas? Please help us.
 
Back
Top