> in some of my cgi scripts who used to use sendmail i am now having them
> use /var/qmail/bin/sendmail,
> what doesnt work now that ive changed is mailing to multiple recipients
> using a commma.
> for example:
>
> mail [EMAIL PROTECTED],[EMAIL PROTECTED] -s test < file.txt

  Simply calling "mail {address}" from a CGI program is almost always a bad
thing.  In many CGI applications, you're getting the email address from
user input, and you have to do things like escape shell characters, watch
for buffer overruns, etc..  It's much better to do something like this to
sendmail or QMail's replacement:

#!/usr/bin/perl
open(MAILPIPE,"|/usr/sbin/sendmail -oi -t") || die;
print MAILPIPE <EOH1
To: $address1, $address2
From: [EMAIL PROTECTED]
Subject:  The subject

blah, blah, blah...

EOH1
;

  That way, user-supplied data is never passed on the command-line, and
using multiple addresses works fine.

steve

Reply via email to