[CLUE-Tech] using procmail to send a message to a script?

Dale Hawkins dhawkins at cdrgts.com
Mon Oct 21 08:34:32 MDT 2002


"Todd Williams" <hp205ctl at hotpop.com> writes:

> use a pipe symbol at the beginning of the action line in procmail
> something like:
> 
> :0:
> * procmailrecipe
> | perlscript >> folder

Hmmm... having just skimmed the manual, I believe it is important to
make sure the folder is locked (and remains so) before the pipe is
used.

If I am understanding the manpage, I'd guess the correct answer would
be something like:

:0 c
* procmailrecipe
script_backup

:0 fw
* procmailrecipe
| perlscript

:0 A
folder


The first stanza makes a copy (good for testing!)

The second stanza runs the filter (assuming that it is OK to run more
than one copy of the perl script at once).

The final stanza delivers mail to the folder called "folder".

The key to my understanding of this method is based on the following
from the procmailrc manpage:

       There  are two kinds of recipes: delivering and non-delivering recipes.
       If a delivering recipe is found to match, procmail considers  the  mail
       (you  guessed  it) delivered and will cease processing the rcfile after
       having successfully executed the action line of the recipe.  If a  non-
       delivering recipe is found to match, processing of the rcfile will con-
       tinue after the action line of this recipe has been executed.

       Delivering recipes are those that cause header and/or body of the  mail
       to  be:  written  into  a file, absorbed by a program or forwarded to a
       mailaddress.

       Non-delivering recipes are: those that cause the output of a program or
       filter  to  be  captured back by procmail or those that start a nesting
       block.

I am about to try this myself.  If I am completely wrong or if there
are further questions, I'll be back.

-Dale

-- 
Now playing:
Rocky Soundtrack -  - (1) - Gonna Fly Now (Rocky theme)

Better to have endured moments of sheer terror, than to have died having
lived life a coward.

A good solution now is better than a perfect solution tomorrow.
- From debian-curiosa

Payin' the bills with my mad programming skills.
- Weird Al



More information about the clue-tech mailing list