PDA

View Full Version : Formmail help please


lightningone
09-23-2007, 09:25 PM
Hi all,

Is there anyone around that knows anything about formmail?

I have downloaded one from Matts script archive to use (i have been told to use this one by the web host)

I have everything up online but it isnt working. The HTML is fine the error that im getting is to do with the @recipients area of the form.

Basically all i want is for the form to send an email to info@robtheplumber.com when the submit button is hit.

I have spent most of my w/e trying to get this to work - i dont know anyone that knows Perl - the language i THINK it is in.

Can someone have a look please at my script if you think you may be able to help.

Thanks a hell of a lot in advance of any help anyone can provide.

Here is the Script that i have modified the main error seems to be in the @recipients area of the form. I have changed the @recipients from what it is in the script below to

@recipients = &fill_recipients(@recipents info@robtheplumber.com);

And it still doesn’t work.

If anyone has any idea of exactly the syntax that needs to go in that line to send emails to info@robtheplumber.com please, please let me know!

I have been through the FAQs etc on matts script archive and still im struggling.

Iv just pasted the top of the form in with the bits i have been told i need to alterer as the rest of the form is too long!

Thanks again

H

The script:

#!/usr/bin/perl
##############################################################################
# FormMail Version 1.92 #
# Copyright 1995-2002 Matt Wright mattw@scriptarchive.com #
# Created 06/09/95 Last Modified 04/21/02 #
# Matt's Script Archive, Inc.: http://www.scriptarchive.com/ #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1995-2002 Matthew M. Wright All Rights Reserved. #
# #
# FormMail may be used and modified free of charge by anyone so long as this #
# copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Matthew M. Wright from any liability that #
# might arise from its use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact. #
##############################################################################
# ACCESS CONTROL FIX: Peter D. Thompson Yezek #
# http://www.securityfocus.com/archive/1/62033 #
##############################################################################
# Define Variables #
# Detailed Information Found In README File. #

# $mailprog defines the location of your sendmail program on your unix #
# system. The flags -i and -t should be passed to sendmail in order to #
# have it ignore single dots on a line and to read message for recipients #

$mailprog = '/usr/sbin/sendmail -i -t';

# @referers allows forms to be located only on servers which are defined #
# in this field. This security fix from the last version which allowed #
# anyone on any server to use your FormMail script on their web site. #

@referers = ('robtheplumber.com');

# @recipients defines the e-mail addresses or domain names that e-mail can #
# be sent to. This must be filled in correctly to prevent SPAM and allow #
# valid addresses to receive e-mail. Read the documentation to find out how #
# this variable works!!! It is EXTREMELY IMPORTANT. #
@recipients = &fill_recipients(@recipents);

# ACCESS CONTROL FIX: Peter D. Thompson Yezek #
# @valid_ENV allows the sysadmin to define what environment variables can #
# be reported via the env_report directive. This was implemented to fix #
# the problem reported at http://www.securityfocus.com/bid/1187 #

@valid_ENV = ('REMOTE_HOST','REMOTE_ADDR','REMOTE_USER','HTTP_USER_AGENT');

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

FishMonger
09-23-2007, 10:50 PM
Matt's formmail script (and most of the others from his scriptarchive.com site) is very poorly written and insecure. I'm surprised that your web host recommended it.

You should switch over to the formmail script from the nms project...it's a drop in replacement that is well written and secure and even Matt recommends using it instead of his own script ( Matt's recommendation http://www.scriptarchive.com/nms.html ).

nms FormMail
http://nms-cgi.sourceforge.net/scripts.shtml

The nms script is well documented, but if you have problems, you can ask us or the nms team. http://nms-cgi.sourceforge.net/support1.html