1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice

qmail-inject not working for users?

Discussion in 'Plesk for Linux - 8.x and Older' started by devindull, Jul 20, 2005.

  1. devindull

    devindull Guest

    0
     
    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='webmaster@tommywho.com';

    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.
     
Loading...