Solved

My formmail script is not working

Posted on 2003-12-01
2
365 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now