Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

My formmail script is not working

Posted on 2003-12-01
2
Medium Priority
?
372 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 1200 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

Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

Question has a verified solution.

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

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…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

721 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