I emailed the hosting service about uploading in binary vs. ASCII (I've just been dragging files onto the ftp site with Internet Explorer) and execute permissions for the FormMail file, here's the response I got back:
"You are correct in saying that CGI scripts should be uploaded in ASCII. Any text files are uploaded in ASCII and all image files are uploaded in Binary. This is something that any FTP client should do automatically, even Internet Explorer.
You do not need to set the file permisssions for CGI scripts. As they are uploaded to the cgi-bin they are modified to be executable, so they will run when a call is made to them."
I think it's a Linux server because of the following info from the hosting service, which I used to configure the $mailprog setting:
"This applies to:

Perl scripts using the sendmail daemon on Linux servers


A recent (May 2004) tightening of security on Fasthosts SMTP servers will affect the syntax of commands used to initialise the sendmail program.

A sendmail script in which the -f paramater is NOT specified in the initiatlisation, will fail. Without this paramater, the smtp server will treat the email as sent from domainxxxxx@localhost.

If the script has ( for example ):

$mailprog = "/usr/sbin/sendmail";

This would need to be replaced with:

$mailprog = "/usr/sbin/sendmail -faddress\@customers-domain-name";

Note: Remember to replace address\@your-domain-name with a valid email address on your domain.

If your form submits an email to your domain with the sender marked as the customer, you will need to use the following:

/$mailprog = "/usr/sbin/sendmail -f$email";

Where $email is the variable which holds the customers email address.

Additionally, an email from an external email address which is cc'd to another external address, will fail.

The cc'd email is, in essence from a non-Fasthosts address to a non-Fasthosts address. This causes the email to fail."


I went back to the original FormMail file, changed only

$mailprog = '/usr/sbin/sendmail -f$email -oi';

$postmaster = '';

@referers = qw( localhost);

@allow_mail_to = qw( localhost);


I also tried

$mailprog = '/usr/sbin/sendmail -oi'; and

$mailprog = '/usr/lib/sendmail -f$email -oi';


Everything else in the FormMail file is exactly as I got it.


The URL of the page with the form is


Thank you for your help,



----- Original Message ----
From: Todd Alan Smith <>
To: Susan Paigen <>
Sent: Friday, August 25, 2006 4:47:30 PM
Subject: Re: [Nms-cgi-support] FormMail error message

On 8/25/06, Susan Paigen <> wrote:
> I'm trying to set up to use the FormMail 3.14cl script to email the content
> of a registration form. The error message I get is "The CGI application
> misbehaved by not returning a complete set of HTTP headers." I have gone
> looking on the net to see if I can find any info about this error with no
> results. I have tried both 0 and 1 as the values for $allow_empty_ref. Any
> help would be greatly appreciated.

Susan, this is a generic error message, generated by IIS, which
basically lets you know that something has gone awry. The best place
to start is the NMS support page:

The above page lists various common problems, as well as the
information which you should post to the list, in order to help us
diagnose your problem.

Next, you should read the following item:

Hope that gets you started in your troubleshooting.


> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> _______________________________________________
> To unsubscribe from this mailing list visit
> and follow the simple instructions.