codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  PERL :: BFormMail.pl :: Forbidden Error :: ( - Idiot needs help. - )  terrilynn_kansascity at 01:31 on Thursday, July 21, 2005
 

I am absolutely stumped! (...I am NOT a programmer, or a coder...just a dumb-dumb trying to install this properly.)

If you can't answer my questions, perhaps you could point me to a resource where I can try to find the answers, or to another BB where I can ask for help.

I am getting a "FORBIDDEN" error on a script; BFormMail.pl
Available at: http://www.infosheet.com/iScripts.html
This is an enhanced version of Matt Wright's FormMail Script.
This script creates a email on the fly...does not require a template for results.

I have run other cgi scrips on my server without a problem. So, I know that my domain will allow cgi.

...here's what Ive done so far.
Editing the .pl in Notepad (to avoid unwanted formatting) I configured the .pl as follows;

(PERL PATH; according to my cpanel, this is the correct path to perl...didn't change the first line of the .pl):
#!/usr/bin/perl

(SENDMAIL; sendmail didn't need to be changed...my path was the path specified:
$mailprog = '/usr/sbin/sendmail -i -t';

(REFERERS; forms reside only on my domain, and should only be used on same):
@referers = ('my-domain.com');

(RECIPIENTS; I need to send cc's to other people who have web-based mail accounts, and so I put the generic names in recipients): @recipients = &fill_recipients('my-domain.com','yahoo.com','hotmail.com','excite.com','msn.com');

-(VAILD ENV; didn't see a need for this option at this time; didn't change the preset);
@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');

(REAL SENDER; I have a mail account set-up for postmaster on my domain);
$xrealsender = 'postmaster@my-domain.com';

-(FAX SERVICES; didn't require fax services...didn't change the presets.): $faxstamp = 'passwd';

-(ENABLE DEBUGGING; didn't know how to use this option, so I left the preset off): $enable_debug = 0;

THEN...
- I uploaded the .pl to my cgi-bin.
- I created a blank file for the database (data.dat) and uploaded that to a different folder on the domain (NOT inside the cgi-bin folder).
- I uploaded a copy of an included testBFM form to another folder after changing the paths, URLs, and emails references.
- The form method action is set to:
<form action="http://www.my-domain.com/cgi-bin/BFormMail.pl" method="post">
- I set the recipient form field tag to an email address that does exist on my-domain.com.
- I set the cc form field tag to an address that does exist on msn.com.
- I set the bcc form field tag to an address that does exist on yahoo.com.

THEN I tried to adjust the permissions.
(Which is probably where I screwed up.)
CHMOD Permissions are curently set at:
-- cgi-bin :: 755
-- BFormMail.pl :: 644
-- data folder (where flat-file db is stored) :: 773
-- data file (the actual flat-db-file) :: 644
-- form folder (where form html is stored) :: 755

I can't see what I've done incorrectly! And I can't find the answers to my questions because I don't know what my questions are. If you could assist, I would be very grateful.

Thank you in advance of ANY answer you can provide. I'll be hovering around here looking for a reply...sometime soon.

Terri Lynn in Kansas City.

  Re: PERL :: BFormMail.pl :: Forbidden Error :: ( - Idiot needs help. - )  javabits at 21:48 on Tuesday, August 02, 2005
 

I would guess that you have something wrong with the permissions.

-- cgi-bin :: 755
-- BFormMail.pl :: 644
-- data folder (where flat-file db is stored) :: 773
-- data file (the actual flat-db-file) :: 644
-- form folder (where form html is stored) :: 755

cgi-bin should be ok

BFormMail.pl now has permissions rw-r--r-- (read-write owner, read group, read other). You may want to assign it 744 which will give it execute permissions. If that doesn't work the cgi process is most likely running as a different user and you may need to change the owner or change the permissions to 755 (rwxr-xr-x)

I would see if it works after making this change and then if it does you might consider tightening up permissions on the rest
data folder to 774 or even 744 (rwxr--r--)
data file is probably fine
form folder is probably fine

Hope this helps,

semper fi...








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007