procmail
[Top] [All Lists]

Re: Perl and Procmail

1997-03-26 10:30:10
"Lista" == Lista da Horda <lista(_at_)horda(_dot_)com> writes:

Lista> How can I, after receiving an email and dropping it intoi a
Lista> specific location, execute an perl script to work with it.

# Protect the following recipes by grouping them into {}'s and using a
# lockfile
:0: some.lockfile
* conditions
{
# Place it in a file. The `c' flag makes sure procmail continues.
# We already have a lockfile, so we don't need a second `:'
:0c
| cat >file

# Now we run the perl script. The `i' flag makes sure procmail doesn't
# complain about broken pipes. The `h' flag could optimise a little.
:0ih
|your perl script
}

Hint: If you rewrite your perl script to read from STDIN, things will
be easier. The complete set of recipes would reduce to:

:0
* conditions
| your perl script

-- 
Guy Geens <guy(_dot_)geens(_at_)iname(_dot_)com>
Home Page: http://www.elis.rug.ac.be/~ggeens
finger ggeens(_at_)elis(_dot_)rug(_dot_)ac(_dot_)be for PGP public keys (or use 
keyserver) 

<Prev in Thread] Current Thread [Next in Thread>