* Summary: Sending mail to a perl script.
@ 1996-05-02 5:47 Garry Optland
0 siblings, 0 replies; only message in thread
From: Garry Optland @ 1996-05-02 5:47 UTC (permalink / raw)
To: tru64-unix-managers
Hi All,
The answer is to change the alias from:
test: "| /usr/local/mail/bin/test.pl"
to:
test: "| /usr/bin/perl /usr/local/mail/bin/test.pl"
I recieved four replies in 30 minutes. Thanks to:
Andreas Priebe <apr@aip.de>
drjohn <drjohn@windom.colorado.edu>
Mahendra Vallabh (Mike) <mike@lucy.cs.waikato.ac.nz>
Jay Shen <jshen@emperor.kidsat.ucsd.edu>
and any others that may yet answer.
My original question:
>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: <test@pp.nsw.gov.au>)
>
> ----- 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
--------------------------------------------------------------------
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-05-02 5:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-05-02 5:47 Summary: Sending mail to a perl script Garry Optland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox