Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

(Probably it's not a perl problem, but I didn't find anything on sendmail.org)

I'm writing this "free webmail" script, and I'm in the part of the delivery system. I want to send all the incoming mails to a script that will put the mails on a mysql database, or something.. So I put this on /etc/aliases:

free_mail: "|/usr/bin/deliver.pl user"

But when I send an e-mail, it bounces with this error:

sh: deliver.pl not available for sendmail programs
554 "|/usr/bin/deliver.pl user"... Service unavailable

Do I have to do anything special with the script? the script is very simple right now, something like:

#!/usr/bin/perl $user = $ARGV[0]; open(MB,">>/home/mailboxes/$user"); while ($line = <STDIN>) { print MB $line; }; close(MB);
Is there anything else I have to do to make it "available for sendmail programs"?

Thanks!

Ariel.

Replies are listed 'Best First'.
Re: Using perl to deliver e-mails
by mdillon (Priest) on May 22, 2000 at 06:12 UTC
    this question is answered in the Sendmail FAQ. Sendmail is using the "sendmail restricted shell", smrsh, which only allows files to be executed which are symlinked from a predefined, restricted path.

    p.s. it's great to see a legitimate Anonymous Monk post. i was afraid it would never happen again.

RE: Using perl to deliver e-mails
by KM (Priest) on May 22, 2000 at 06:13 UTC
    This is actually answered in the sendmail FAQ at

    http://www.sendmail.org/faq/section3.html#3.34

    This sounds like it may be your issue.

    Cheers,
    KM