[Perl] NMS Formmail to field and address_style setting issues

The first issue that I’m having is that when I send an e-mail, the from field is [some weird e-mail]@mydomain.com. Note that my code should work, as I have the email field. Also, the name isn’t what it should be, despite the realname field. Here’s the HTML:


<form method="post" action="/cgi-bin/mymail.pl" onsubmit="report();return send404(this);">
<div>
<input type="hidden" name="realname" value="*****" />
<input type="hidden" name="email" value="*****" />
<input type="hidden" name="env_report" value="REMOTE_HOST,REMOTE_ADDR,REMOTE_USER,HTTP_USER_AGENT" />
<input type="hidden" name="subject" value="Webpage Error" />
<input type="hidden" name="recipient" value="2" />
<input type="hidden" name="redirect" value="*****" />
<input type="hidden" name="comments" id="comments" value="" />
<input type="submit" value="Send 404 Error" />
</div>
</form>

The second issue is that if I change the address_style, I get an error: “Close sendmail pipe failed…”

Here’s the configurable part of the Perl file.


BEGIN
{
  $DEBUGGING         = 1;
  $emulate_matts_code= 0;
  $secure            = 1;
  $allow_empty_ref   = 1;
  $max_recipients    = 5;
  $mailprog          = '/usr/sbin/sendmail -oi -t';
  $postmaster        = '';
  @referers          = qw();
  @allow_mail_to     = qw(*****);
  @recipients        = ();
  %recipient_alias   = (
    '1',*****',
	'2','*****'
  );
  @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 %Z';
  $style             = '/css/nms.css';
  $no_content        = 0;
  $double_spacing    = 1;
  $wrap_text         = 0;
  $wrap_style        = 1;
  $address_style     = 0;
  $send_confirmation_mail = 0; #This is what I can't change without getting an error.
  $confirmation_text = <<'END_OF_CONFIRMATION';
From: [email]you@your.com[/email]
Subject: form submission

Thank you for your form submission.

END_OF_CONFIRMATION

Thanks!