procmail
[Top] [All Lists]

Re: Perl scripts not recognized as such?

2008-12-04 12:17:57

Hmmmm. What does the script DO? That sort of 'works some of the time'
behaviour suggests that it is conditional on message content. You wouldn't
happen to be using 'eval' statements in your script, would you? These
could barf on stray unexpected characters in headers.... 

- Charles

On Thu, 4 Dec 2008, Bill Oakley wrote:
I'm using procmail to spool my "interesting" mail to my system mailbox
and my "uninteresting" mail to a secondary mailbox.  Specifically, I'm
using a Perl script and testing it's exit status.  My recipes are:

:0Wi:
* ? $HOME/Mail/billo2.pl
$HOME/Mail/billo2

:0:
$DEFAULT

My Perl script begins with:

#!/usr/local/perl/bin/perl

The problem I'm seeing is that sometimes the Perl script doesn't seem
to be recognized as a Perl script; my procmail log file contains:

procmail: Executing "/home/staff/billo/Mail/billo2.pl"
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: my: not found
/home/staff/billo/Mail/billo2.pl: syntax error at line 10: `)' unexpected
procmail: Non-zero exitcode (2) from "/home/staff/billo/Mail/billo2.pl"
procmail: No match on "/home/staff/billo/Mail/billo2.pl"

It's as though the Perl script is being interpreted as a shell script.
(And if I remove the "#!" line and run the script interactively I see
the same errors.)  But again, this only happens some of the time - the
rest of the time the script runs and the messages are spooled
correctly.

Any ideas about what the problem may be?

Thank you for your help.

Bill
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail