PDA

View Full Version : formmail.pl Help


rfresh
03-13-2009, 10:37 PM
I've got my formmail.pl working with my web page form, however, when the response email arrives, the From address is:

"nobody@aerostar.websitewelcome.com"

What can I configure so that is shows "sales@mysite.com"

Thanks...

FishMonger
03-13-2009, 10:59 PM
There are a number of different formmail scripts available, which one are you using?

rfresh
03-14-2009, 12:07 AM
Matt's

FishMonger
03-14-2009, 01:31 AM
Matt's script is poorly written and insecure. Instead of trying to use it, you should replace it with the one from the NMS project, which is a drop-in replacement and is well written. Even Matt recommends using the nms script over his own.

The nms Project: http://nms-cgi.sourceforge.net/scripts.shtml

Matt's recomendation: http://www.scriptarchive.com/nms.html

rfresh
03-14-2009, 02:42 AM
I downloaded the new script, set my parameters and it does the same thing - ignores the email address I have set into the postmaster field :-(

rfresh
03-14-2009, 02:46 AM
In formmail.pl I tried the -f switch and that didn't work either.


$postmaster = '-fsales@mysite.com';

FishMonger
03-14-2009, 02:54 AM
Please post your html form code and the config section of the formmail script.

rfresh
03-14-2009, 04:15 AM
<Form Method="POST" Action="http://www.mysite.com/cgi-bin/formmail.pl">
<input type="hidden" name="subject" value="Information Form">
<input type="hidden" name="recipient" value="sales@mysite.com">
<input type="hidden" name="redirect" value="http://www.mysite.com/THANKYOU.HTM" />
<input type="hidden" name="required" value="FirstName,LastName,Email">



BEGIN
{
$DEBUGGING = 0;
$emulate_matts_code= 0;
$secure = 1;
$allow_empty_ref = 1;
$max_recipients = 6;
$mailprog = '/usr/sbin/sendmail -oi -t';
$postmaster = 'sales@mysite.com';
@referers = qw(mysite.com);
@allow_mail_to = qw(sales@mysite.com);
@recipients = ();
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER HTTP_USER_AGENT);
$locale = '';
$charset = 'iso-8859-1';
$date_fmt = '%A, %B %d, %Y at %H:%M:%S';
$style = '/css/nms.css';
$no_content = 0;
$double_spacing = 1;
$wrap_text = 0;
$wrap_style = 1;
$address_style = 0;
$send_confirmation_mail = 0;
$confirmation_text = <<'END_OF_CONFIRMATION';
From: you@your.com
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION

FishMonger
03-14-2009, 02:06 PM
The form code you posted is incomplete. Do you have a form field for the user to enter an email address and if so, is the name attribute for that field set to "email"?

Try setting $mailprog to this:
$mailprog = '/usr/sbin/sendmail -oi -t -f sales@mysite.com';

rfresh
03-14-2009, 05:26 PM
It was the form email field - it was not named email. Once I changed that then it worked fine. Thank you very much!

bazz
03-14-2009, 06:18 PM
Hi Fishmonger,

I have seen you direct people to nts formmail project tons of times. Would it be worth making it into a sticky or maybe just simpler?

bazz