procmail
[Top] [All Lists]

Re: Have procmail continue to parse a message after a condition is met.

1997-10-14 08:05:36

Here is the scenario,

:0:                            
* ^TOplasma
! plasma(_at_)erinet(_dot_)com

:0:                            
* ^TOroot
! root(_at_)mailhost         

This little condition looks for plasma then when found forwards it to me.
But the next condition is not even considerd.  What if the message was to
both?

I didn't see a reply from any of the experts, so here's a method from a
non-expert (with sarcastic use of bodily fluids):

:0c
* ^TOplasma
! plasma(_at_)erinet(_dot_)com

:0c
* ^TObile
! plasma(_at_)erinet(_dot_)com

:0c
* ^TOphlegm
! plasma(_at_)erinet(_dot_)com

:0
* ^TOroot
! root(_at_)mailhost         

The 'c' means Copy the message and continue reading the recipes instead of
stopping as soon as one matches.  The 'c' is omitted from the LAST one so
that IF it matches, it is the last forward taken but IF it does not,
procmail continues reading recipes.

the colon is removed because there is no need for a lockfile.  A lockfile
is for when a recipe puts the message in a mailfile and you want to make
sure that two messages arriving almost at the same time for the same file
don't clobber each other.  Since you are forwarding, not filing, you don't
have to worry about that.

If you look back through the list archives, you may find better methods.

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