Current location: Hot Scripts Forums » Programming Languages » Perl » Formmail permissions problem...


Formmail permissions problem...

Reply
  #1 (permalink)  
Old 05-22-06, 05:38 PM
Clark_Kent's Avatar
Clark_Kent Clark_Kent is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Question Formmail permissions problem...

Hi Everyone,

I have a problem setting up my formmail script. I downloaded the latest version of the FormMail script at Matt's Script Archive... and i think i have set it up properly, i followed some guidelines. Anyway the problem i am experiencing is when i submit the data on my form it is supposed to access the formmail script, instead i get a page that states i dont have permission to access /cgi-bin/FormMail.cgi. I've used dreamweaver to put together this form. Here is the code i've used to construct the form, i'll just post the line i think is causing the problem...

Code:
<form action="http://www.antoniopires.net/public_html/cgi-bin/FormMail.cgi" method="post" name=main_form id="main_form" onsubmit="return validateOnSubmit('eng')">
Now if the Forbidden error page comes up i can only assume that it is actually trying to access the formmail script and therefore the path in the action attribute above is correct. The permission setting i have set for the formmail script is 755. Now that is where i'm left stumped because i've learnt that the permission setting for the formmail script needs to be 755. Just to clarify what the error states here is exactly what it says:
Code:
Forbidden

You don't have permission to access /public_html/cgi-bin/FormMail.cgi on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Other than the form itself, the actual perl script (formmail.pl) has variables that the user needs to modify. I am going to post only the lines of code i modified, i'm not too sure if the lines of code i have modified are the only ones i should modify so if i need to modify more than just what i have modified i would highly appreciate it if you guys could tell me.

Here are the lines of code i modified....

Code:
# $mailprog defines the location of your sendmail program on your unix       #
# system. The flags -i and -t should be passed to sendmail in order to       #
# have it ignore single dots on a line and to read message for recipients    #

$mailprog = '/usr/sbin/sendmail -i -t';

# @referers allows forms to be located only on servers which are defined     #
# in this field.  This security fix from the last version which allowed      #
# anyone on any server to use your FormMail script on their web site.        #

@referers = ('www.antoniopires.net','111.111.11.11');
Those are the only variables i modified, there are others but i'm not sure if i need to modify them... this is my first time using the formmail script, unfortunately. The script i downloaded can be found at the following address.. http://www.scriptarchive.com/download.cgi?s=formmail

If i'm doing something wrong with the perl script or the form i would greatly appreciate anybody pointing out what i should be doing or possible solutions.

Thanks for your time ,

- CK

Last edited by Clark_Kent; 05-22-06 at 05:47 PM.
Reply With Quote
  #2 (permalink)  
Old 05-22-06, 11:43 PM
Millennium's Avatar
Millennium Millennium is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
normally you don't include public_html in the URl so try this:

action="http://www.antoniopires.net/cgi-bin/FormMail.cgi"
Reply With Quote
  #3 (permalink)  
Old 05-23-06, 06:58 AM
Clark_Kent's Avatar
Clark_Kent Clark_Kent is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Millennium ,

Thanks for your response. I had already tried that as well, i assumed that since the URL (www.antoniopires.net) pointed to an index file within the public_html directory that you wouldn't need to include the 'public_html' folder in the URL to access the cgi script.

It still comes up with the forbidden error unfortunately. The variables that i have modified, are those pretty much all the ones i need to modify? Are those the only ones you modified? (assuming you or anyone else has worked with the latest FormMail.pl script).

Lastly, when i downloaded the FormMail script it had an extension of '.pl'. I tried using that extension at first when i started testing out the form but the result was still the same as it is now. I then changed it from '.pl' to '.cgi' hoping that would fix the problem, but apparantly it hasn't.

Any other ideas? It feels like something small needs to be done to resolve this issue, i'm just not sure what due to not having used this script before .

Thanks for your input ,

- CK
Reply With Quote
  #4 (permalink)  
Old 05-23-06, 11:04 AM
Clark_Kent's Avatar
Clark_Kent Clark_Kent is offline
Newbie Coder
 
Join Date: Mar 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Formmail permissions problem... SOLVED

No worries guys, i have solved the problemmo.

Basically what was happening was my server was blocking the formmail.pl script. Since the formmail script is targeted a lot, my server blocks any script that is named formmail.pl. I solved the problem by renaming the formmail.pl script to something else, eg. somethingelse.pl. Another problem was one of the variables in the formmail.pl script not being set properly. I left the recipients value set to its default value...

Code:
@recipients = &fill_recipients(@referers);
In the README file that comes along with the formmail.pl script it states the recipients field can be left to its default setting but if it doesn't work there are other alternatives documented in the README file. I chose an alternative and it worked fine.

It takes a few minutes to receive an e-mail after the form has been submited but thats good enough, better that than the e-mail never arriving . Other than that, another minor mistake on my part after realizing my server was blocking the formmail.pl script was not setting the 'id' attributes of each form field correctly. If you're using dreamweaver like i am you have probably noticed that if you select a form field, and then name it, say for example a textfield, and you then name it in the properties panel, not only does the name obviously change but so does the 'id' attribute. So if i change my e-mail field from 'email' to 'E-mail' in the properties panel, the 'id' attribute of that e-mail field changes to 'E-mail' as well. Quite a small irratating thing that kept the formmail.pl script from sending e-mails correctly. So it's always good to check the actual code of your form instead of relying on dreamweaver to take care of everything.

That's pretty much it, i hope this helps anybody who experiences the same prob .

- CK
Reply With Quote
  #5 (permalink)  
Old 05-23-06, 12:38 PM
Millennium's Avatar
Millennium Millennium is offline
Wannabe Coder
 
Join Date: Nov 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
Glad you solved it. Nice of you to post how you solved it too.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FormMail problem elclark Perl 0 04-17-05 09:49 PM
Perl FormMail Problem ennanguyen2002 Perl 2 03-09-05 04:47 PM
Formmail Problem - Can't use on home computer itseabass Perl 2 11-20-04 10:29 PM
formmail problem gscraper Perl 12 08-27-04 03:06 AM
Dataset problem: table permissions? petersza ASP.NET 0 10-15-03 10:59 AM


All times are GMT -5. The time now is 04:09 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.