Lunarpages Web Hosting Forum

Scripting Languages Hosting Help => C++ / PERL / CGI Support => Topic started by: FST2005 on October 03, 2005, 09:05:13 PM

Title: Please help finding error in FormMail
Post by: FST2005 on October 03, 2005, 09:05:13 PM

   I tried going to lunarpages live chat help and the tech's there said my best bet would be to come here and post the script.

   To give you a bit of better understanding...I have a main act lets call it and it has a formmail script in the cgi-bin folder. Its working just fine and has been for about 1 year.

   I created a add-on domain lets call it In the folder of the addon is another cgibin folder. Before uploading the script I opened it in notepad and saved it, so as to create the ASCII format. Then I uploaded the formmail script into the addon cgi folder. I changed the permission on the script to 755 and also made sure the cgi folder was set to 755.

I also noticed that in the main act cgi-bin (working) folder, there are a few other files, like cgiecho, andcgiemail. Should I have these files also in the other addon cgi folder?

The contact website is

   The Problem is I keep getting a:

** Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at Port 80 **

   The techs from live chat tried looking at what they could and said it seems like there is an error in the script. I asked them if its ok to post the whole script here and they said it was please dont get all pissy.

Here it is:

#!/usr/bin/perl -wT
# NMS FormMail Version 3.14c1

use strict;
use vars qw(
  $DEBUGGING $emulate_matts_code $secure %more_config
  $allow_empty_ref $max_recipients $mailprog @referers
  @allow_mail_to @recipients %recipient_alias
  @valid_ENV $date_fmt $style $send_confirmation_mail
  $confirmation_text $locale $charset $no_content
  $double_spacing $wrap_text $wrap_style $postmaster

# -------------------
# Version 3.14c1
# This program is licensed in the same way as Perl
# itself. You are free to choose between the GNU Public
# License <>  or
# the Artistic License
# <>
# For help on configuration or installation see the
# README file or the POD documentation at the end of
# this file.

# --------------------------
# Modify these to your own settings. You might have to
# contact your system administrator if you do not run
# your own web server. If the purpose of these
# parameters seems unclear, please see the README file.
  $DEBUGGING         = 1;
  $emulate_matts_code= 0;
  $secure            = 1;
  $allow_empty_ref   = 1;
  $max_recipients    = 5;
  $mailprog          = '/usr/sbin/sendmail -oi -t';
  $postmaster        = '';
  @referers          = qw( localhost);
  @allow_mail_to     = qw( localhost);
  @recipients        = ();
  %recipient_alias   = ();
  $locale            = '';
  $charset           = 'iso-8859-1';
  $date_fmt          = '%A, %B %d, %Y at %H:%M:%S';
  $style             = '/css/nms.css';
  $no_content        = 0;
  $double_spacing    = 1;
  $wrap_text         = 0;
  $wrap_style        = 1;
  $address_style     = 0;
  $send_confirmation_mail = 0;
  $confirmation_text = <<'END_OF_CONFIRMATION';
Subject: form submission

Thank you for your form submission.


# You may need to uncomment the line below and adjust the path.
# use lib './lib';

# --------------------------
# Place any custom code here


     Well I could not post the whole if there is anything else that needs to be posted please let me know. I truly appreciate anyones help in this and want to thank you so much for taking the time to help a fellow lunarpages bro out.


Title: Re: Please help finding error in FormMail
Post by: FST2005 on October 03, 2005, 10:18:56 PM

 While reading just about everything I can find on this problem, I pulled a all night long tweak trying to find the problem. I compared the working script to the bad one and  noticed a part in the script that must have changed some how. The part is:

$style             = '/css/nms.css';

   On the working script it reads:

$style             = '';

    So I deleted the extra text and saved it...but still am having the problem. I am going nuts just trying to figure this out...please someone help.

Title: Re: Please help finding error in FormMail
Post by: FST2005 on October 03, 2005, 11:05:02 PM
I'm just having one of those nights....Well call it never wanting to give up or thick headed, I found the problem and it is now fixed.

Sorry for posting here and hopfully I didnt waste anyones time.

What I did was re-open the very first script and re save everything over again, making sure to watch what I was doing and uploaded the file using cpanel.

Everything worked and all is fine.

I'm going to catch up on some much needed sleep now...good night