Solved

My formmail script is not working

Posted on 2003-12-01
2
368 Views
Last Modified: 2013-12-25
The form located at:-

http://mypcd-24356-001.dsvr.co.uk/

is not posting correctly????

I have definately got the formmail.pl file in the cgi-bin directory of my server with all the correct read/write/execute permissions set.
I have also used the formmail code for a different site on the same virtual server and it works.

Here is a dump of the first few lines of the formmail.pl


# $mailprog defines the location of your sendmail program on your unix
# system.

$mailprog = '/usr/sbin/sendmail';

# @referers allows forms to be located only on servers which are defined
# in this field.  This fixes a security hole in the last version which
# allowed anyone on any server to use your FormMail script.

@referers = ('mypcd-24356-001.dsvr.co.uk','212.69.200.57');

# $recipient_file is the location of a plain text file listing valid
# recipients of formmail emails.

$recipient_file = '/usr/local/etc/formmail_recipients';

# Done
#############################################################################

use Sys::Hostname;

# Check Referring URL
&check_url;

# Retrieve Date
&get_date;

# Parse Form Contents
&parse_form;

# Check Required Fields
&check_required;

# Check that recipient is valid
&check_valid_recipient;

# Return HTML Page or Redirect User
&return_html;

# Send E-Mail
&send_mail;

sub check_url {

   if ($ENV{'HTTP_REFERER'}) {
      foreach $referer (@referers) {
         if ($ENV{'HTTP_REFERER'} =~ /$referer/i) {
            $check_referer = '1';
          last;
         }
      }
   }
   else {
      $check_referer = '1';
   }
0
Comment
Question by:freedmanrp
2 Comments
 

Author Comment

by:freedmanrp
ID: 9865226
still need help?
0
 
LVL 48

Accepted Solution

by:
Tintin earned 300 total points
ID: 9889719
Please DO NOT use Matt's formmail.  It is insecure, poorly written and not maintained.

Use the 100% compatible, secure, well written and maintained Formmail version from http://nms-cgi.sourceforge.net/
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linux Scripting 3 170
Transform normalized CSV to line in powershell 7 50
bulk create of subfolders in multiple parent folders 9 57
Find unused columns in a table 12 77
Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question