* Riccardo Perotti <[EMAIL PROTECTED]>
> open (MAIL, "|/usr/sbin/sendmail -t -i -F'$from_name' - 
> f'$from_mail'") or die "can't open sendmail: $!";
> <- etc ->
> close MAIL or die "can't close sendmail: $!";

If possible, use system LIST instead of system STRING, as the STRING
form runs through a shell, which could run arbitrary commands, and
thereby cause security problems. Better yet, let a module such as
Mail::Sendmail handle the low-level details.

http://search.cpan.org/perldoc/Mail::Sendmail

More details and solutions to the security risk of system STRING:

http://sial.org/howto/perl/backticks/

> What is it that I'm missing? Is there another way of checking for
> sendmail's success from your script?

/usr/sbin/sendmail varies on Mac OS X; older systems (10.2 and below)
ship with Sendmail, and newer systems (10.3 and 10.4) Postfix. Either
could accept a message without error, but hold the message in a queue
due to some other problem at the next SMTP server.

Check the /var/log/mail.log log file for clues, and use the 'mailq'
command to review the status of the local queue directories. For
Sendmail 8.12 and higher, run:

mailq
mailq -Ac

Reply via email to