AlpineWeb Home
Search: For:   ~ Advanced Search  
  Support Home     Documentation     Knowledgebase     Help Desk     Blog 
Support Home > Signature > Add-Ons > Thursday, August 28, 2008

NMS FormMail - Sending E-mail from a Web Form


FormMail is a special script designed to allow you to send e-mails based on the input from an HTML form on your website.

Important Security Information

The original FormMail script was first made available at Matt's Script Archive. This version of FormMail has a number of significant security holes which allow malicious users to relay messages through a vulnerable server.

NMS FormMail is a drop-in replacement for the orignal script which overcomes the security problems associated with FormMail. We strongly urge anyone using FormMail to switch to the NMS version if they are not already using it.

NMS FormMail was specifically designed to be compatible with the original FormMail script, and should not require you to make any changes to your HTML forms already in use when you switch to the NMS version.

Powered by nms Perl scripts

Installing NMS FormMail

The following instructions will guide you through the process of installing NMS FormMail on your Signature Hosting account. Also see: FormMail.README.txt
Note: Signature Hosting Mini plans do not include CGI service but we do provide a HTML form to e-mail gateway. Please contact your account manager for the URL.

Back Up your Current FormMail

If you already have a version of FormMail running on your Signature Hosting account, you should make a copy of it before installing the NMS FormMail script.

Connect to your Signature Hosting File Manager by Logging In to your Control Panel and clicking on File Manager at the bottom of the Site Configuration menu.
Change to your www/cgi-bin folder by clicking on the folder names in the File Manager window.
Click on the Rename link on the line with your current FormMail.pl script. You can accept the default New File Name (Path).

Dowload the NMS FormMail script to your local computer

Click on the link below to download the NMS FormMail script to your local computer. Save the file to a location where you can easily find it after you have downloaded the file.
http://nms-cgi.sourceforge.net/formmail.zip

Unzip and Edit the FormMail.pl file

You will need to extract the FormMail.pl file from the formmail.zip file. You can do this by opening formmail.zip using WinZip (or some other .zip file extraction program) and right-clicking on FormMail.pl and selecting Extract from the context menu. Select a loction where you can remember and extract the file.

Once you have extracted the file, you will need to open it and edit some values. Open the file using NotePad or your favorite text editor. Scroll down to the User Configuration Section and find the following line.
$mailprog = '/usr/lib/sendmail -oi -t';
Change the path to use /usr/sbin/sendmail instead of /usr/lib/sendmail. The line should now look like this:
$mailprog = '/usr/sbin/sendmail -oi -t';
Next, you need to edit the domain names allowed to use the form. Find the following line in the script (it should be just a few lines down):
@referers = qw(dave.org.uk 209.207.222.64 localhost);
Remove dave.org.uk and 209.207.222.64 and put your Signature account domain name in. For example, if your domain name were MY-DOMAIN.NAME, the line should look like this when you are done:
@referers = qw(MY-DOMAIN.NAME localhost);
You will also need to change the allowed recipients. The next line in the FormMail.pl script looks like this:
@allow_mail_to = qw(you@your.domain some.one.else@your.domain localhost);
Remove you@your.domain and some.one.else@your.domain and enter your Signature account domain name. The line should look like this if your domain name were MY-DOMAIN.NAME:
@allow_mail_to = qw(MY-DOMAIN.NAME localhost);
This will allow FormMail to send e-mail to any valid username on your Signature Account. You can also specify specific recipient addresses in this field. For example, if you wanted to be able to send mail only to the user ME@MY-DOMAIN.NAME, you would simply add ME@MY-DOMAIN.NAME instead of just MY-DOMAIN.NAME to the list.

When you are done editing the file, save it (as the same name) and exit the text editor.

Upload the script to your Signature Account

  1. Connect to your Signature Hosting File Manager by Logging In to your Control Panel and clicking on File Manager at the bottom of the Site Configuration menu.
  2. Change to your www/cgi-bin folder by clicking on the folder names in the File Manager window.
  3. Click on Upload File in the Actions menu.
  4. Click on the Browse... button and find the FormMail.pl file on your local computer in the Browser window. Click on Open after you have selected the file to return to the main window, then select Upload File to copy the file to your Signature Hosting server.
  5. Once you've uploaded the file, you need to make it executable. To do this, select the formmail.pl script in the File Manager and select Change Permissions. You will then need to select Advanced Permissions and click on the checkboxes to make the script Executable by Owner, Group, and World. Click on Set New Permissions to make the changes take effect.

Create an HTML Form

If you already have a form, it should now be using the new FormMail.pl script. If it does not work, check to make sure that you are using the correct path to the script and that the script has the same domain and account as your form uses.

If you don't already have an HTML form, create a new file in your www/htdocs/ directory using the File Manager and create one. The following code is an example of how to use FormMail. You may want to adapt the code for your specific use.
<form method="POST" action="/cgi-bin/FormMail.pl">
<input type="hidden" name="recipient" value="order@yourdomain.com">
<input type="hidden" name="subject" value="Order Request">
<input type="hidden" name="required" value="realname,e-mail,phone">
Please Enter Your Name:<br>
<input name="realname" size="40">
<p>
Please Enter Your E-mail Address:<br>
<input name="e-mail" size="40">
<p>
Please Enter Your Phone Number:<br>
<input name="phone" size="40">
<p>
.
.
.
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
Once you have the form in place, test it to make sure that it works properly.


Technical Support
° Getting Started Guides
  FreeBSD
° Basic Hosting Help
° Signature Hosting Help
° VPS v1 Help
° VPS v2/3 Help
° MPS v2/3 Help
  Linux
° VPS v3 Help
° MPS v3 Help
  SaaS
° Sugar CRM
  DNS
° Domain Name Service
° Domain Registration
° Help Desk
° Knowledgebase
° Support Policies
° Disclaimer

° AlpineWeb Home
° Compare Hosting Plans
° Network Topology

° Rates & Fees
° Order Center




  Home | Site Map | Customer Backroom Copyright  ©  1997-2008  AlpineWeb Design