On Fri, Jul 16, 2004 at 02:04:21PM -0700, Jim Osborn wrote:
I've tried several variations on Dallman's suggestion, with these results:
[unsuccessful results snipped]
I'm stumped. I can't think of any other variations to try. Surely
there's a way to avoid maintaining two entire separate rc files,
short of an installation script that hacks the variables as it installs?
First of all, Jim, I don't think it's entirely fair to state that
the choices are either two separate rc's or a variable action line.
There are lots of other choices, including an "else" recipe with
an "E" flag.
I do sort of do something similar to what you seem to be asking
for, however, in my self-rolled list-admin rc that I created to
manage the Virus Snaggers list. The list rc I made "listens" to,
at present, only two commands in the Subject: "subscribe" or
"unsubscribe". It performs a different thing depending on
which one it sees. And it does this in one recipe.
I did find that the way I could make this work was to do the action
in a condition test, however, rather than on the action line.
Here is part of the code.
This one finds "unsubscribe". We'd already weaned out above anything
that was not "^^(un)?subscribe\>", fwiw:
:0
* LISTCMD ?? ^^u
{ SHELCMD = "rm" }
:0 E
{ SHELCMD = "touch" LISTINFO = "$HASH/mylists/vsnag.instructions" }
And here, later on in the rc, is where we run the command:
:0 # 040428 () try our command
* ? "$SHELCMD" -f "$VSNAG/$MEMBER"
{ LISTCMD_STATUS = succeeded }
On the other hand, Jim, I really was sort of just being cute or too
clever, for the fun of it. Probably a more straightforward way is
to use an E-flag recipe. If you are testing, set a var. (I use "$TEST";
imagine that!)
:0
* TEST ?? .
|
:0 E
! $maintainer
--
dman
____________________________________________________________
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