Web Hosting Talk







View Full Version : Need help with formmail.pl script


peloton
01-16-2001, 06:04 AM
Can someone here please help me with the following problem. I've been trying on various form mail script on my RaQ 4 without any luck. One script that I got was formmail.pl from Matt's Scripts. Here are the steps that I took:

1. I put the formmail.pl script via FTP into my CGI-BIN.

2. Create a form mail on my web page with the following code --

<FORM METHOD=POST ACTION="http://mydomain.com/cgi-bin/formmail.pl">
<input type=hidden name="recipient"
value="info@mydomain.com">
<input type=hidden name="subject" value="Request for Information">
<input type=hidden name="return_link_url" value="http://mydomain.com/confirm.htm">
<input type=hidden name="return_link_title" value="Back to Main Page">

The result is the following message:

Execution of (/home/sites/site2/web/cgi-bin/formmail.pl) is not permitted for the following reason:

Script file not found.

I'm going crazy trying to fix this problem. Isn't there some sort of send mail script already pre-configured on the RaQ 4?

Any help is greatly appreciated.

sodapopinski
01-16-2001, 06:23 AM
Try to call http://mydomain.com/cgi-bin/formmail.pl directly. Not through HTML form.
If the browser said file not found, I guess the script alias dir setting does not recognize your cgi-bin dir.

If you are on virtual hosting packages, contact your server admin.
If you are the server admin, check the httpd.conf file.

Hope this help.

Chicken
01-16-2001, 09:44 AM
I use that script on my RaQ3 without problems. Not that that helps...

complete
05-10-2001, 04:51 PM
I was getting errors like that at one point.

I can't remember the exact solution, so you check each of these:

1. As previously noted, run the straight command (i.e. http://www.mydomain.com/cgi-bin/script.pl)
2. CGI script uploaded to sever in ASCII mode
3. Try placing a "--" after the first line, i.e.
#!/usr/bin/perl --

Also, make sure that the first line is pointing to the correct spot where you have Perl installed.

Hope that helps.

huck
05-10-2001, 05:06 PM
Some things to check

Path to Perl
Make sure the path to perl is correct.

Transfer Mode
Did you transfer in ACSII? Sometimes you can get extraline characters will which kill a script.


CGIWrap?
Are you running cgiwrap? This can cause many headaches as permissions have to be set exactly correct.

Permissions
Make sure you have the correct permissions on the script. I run my cgi's as 755.

Ownership
Make sure the owner/group of the file is set correctly.

Check the Script
Run the script from the command line:
perl -c scriptname
this will check the syntax
perl -s scriptname
will run the script on the command line for you
this is a good way to make sure nothing is wrong with the script.

Check paths
Make sure any paths that the script requires are set correctly. You could be getting a not found error due to an incorrect path.

Check Requirements
Make sure that all required files to run the script are in their proper locations

huck
05-10-2001, 05:24 PM
Last I knew, formmail.pl was a highly insecure script and could be used to send SPAM, expose enviroment variables and other malicious activities.

Formmail as Open Mail Relay:eek:
http://www.securiteam.com/securitynews/Formmail_pl_Can_Be_Used_As_An_Open_Mail_Relay.html

Formmail shows Enviroment Variables:eek:
http://www.securiteam.com/exploits/5NP0I0U1GG.html

Many security scanners automatically checks for formmail.pl exploits -- making you a great target for the script kiddie.


Personally, I would use a different form handler. Take a look in one these archives for alternatives.

CGI-resources
http://www.cgi-resources.com

Hotscripts
http://www.hotscripts.com