procmail
[Top] [All Lists]

Re: assigning pipes and commands to Variables

2001-09-03 19:14:48
Brian asked (and I write this in light of having seen Philip's answer),

| I want to source procmail rules that someone else wrote.  They use a
| variable for the action of each rule.  It is intended that each variable
| be set to a mailbox name.  However, I use mbx mailboxes ...
| So, to deliver my mail the rules need to pipe to ... dmail, i.e.,

| :0
| * ^Subject:.*Test
| | /usr/local/bin/dmail +Test

| I want to set a variable with the action.  I expected it to be something
| like this:
| TEST_MAIL="| /usr/local/bin/dmail +Test"

And that doesn't do the job.  But there might be a different approach.

What information exactly is returned after you call the other person's code
as an INCLUDERC?  How do you know the name of the variable that got set to
the name of the mbox where (s)he would have stored such a message?  You
wanted to do this:

INCLUDERC=/path/to/other/user\'s/rcfile # sets value of $MBOX, but you need
                                        # to use it as an mbx
MBX="| /usr/local/bin/dmail +$MBOX"
:0 # and it doesn't work
$MBX

but even if it did, *your* rcfile still has to know somehow that MBOX was
the name of the variable that other person pointed to his/her selected mbox.
Your post implies that that isn't part of the problem; therefore I'm
deducing that you know the name of the variable.

So can't you just do this instead?

INCLUDERC=/path/to/other/user\'s/rcfile # sets value of $MBOX
:0
| dmail +$MBOX # /usr/local/bin/ really should be in $PATH



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

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