From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96076332421142.tru64-unix-managers.marc@archive.invalid> From: Garry Optland Date: Thu, 02 May 1996 04:06:56 +0000 To: tru64-unix-managers Subject: Sending mail to a perl script. X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96076332421142 Hi All, I wonder if anyone has an example of sending mail to a perl script. I want to set up a mail alias that takes the mail message and passes it to a perl script where it is further processed. I am using sendmail 8.7.4, with IDA. In the alias file I tried: test: "| /usr/bin/cat > /tmp/test" This works OK. I then created a perl script that takes stdin and writes it to a file. I can test it from the command line, ie: cat mailfile | test.pl and it works OK. When I change the xaliases file to: test: "| /usr/local/mail/bin/test.pl" I get error messages from sendmail: ----- The following addresses have delivery notifications ----- "| /usr/local/mail/bin/test" (unrecoverable error) (expanded from: ) ----- Transcript of session follows ----- /usr/local/mail/bin/test: /usr/bin/perl: cannot execute 554 "| /usr/local/mail/bin/test"... unknown mailer error 1 I have tried without success sending mail to a script starting with: #!/usr/bin/perl, and with: #!/bin/sh eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; (As per the perl book). At this stage, I am lost, and would really appreciate it if someone could show me how to send mail to a perl script. Regards, Garry. -------------------------------------------------------------------- Garry Optland - Unix Specialist Email: garry@pp.nsw.gov.au Pacific Power phone: +61 2 268 6160 Park & Elizabeth Streets Sydney NSW 2001 Australia --------------------------------------------------------------------