procmail
[Top] [All Lists]

Re: Deliver to program stored in variable

2003-05-12 14:42:02
On Mon, May 12, 2003 at 04:01:44PM -0400, Jake Di Toro wrote:

Sigh... I've been trying this out in about evey combination I know of,
but it doesn't seem to want to work.  I'm trying to do the following:

$DELIVER="| /path/to/program -default -parameters"

:0
* Condition 1
$DELIVER -more -parameters

:0
* Condition 2
$DELIVER -different -parameters

:0
$DELIVER

[end code]

Alternatevly I wouldn't might the default parameter set to also be
$DEFAULT, but I'm not pushing it right now.

This usually ends up being undelerviable or if I take out the '|' and
put it into the code, I end up writing out to a file called '|'.  I've
tried " and ' and even no quotes, but it fails to deliver to the
program.  Am I stuck with having to specify the program every time or
am I missing something obvious.

You're missing something obvious.  :)  You want a SWITCHRC (see `man
procmailrc') for the task.

For example,

        :0
        * some conditions
        { DELIVERYARGS = "some args"    SWITCHRC = deliver }


Under the separate rc-file "deliver", you have, e.g.,

        :0
        | yourprogram "$DELIVERYARGS"

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail