Solved

My formmail script is not working

Posted on 2003-12-01
2
370 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
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 …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 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