procmail
[Top] [All Lists]

Re: Combining Recipes

1997-06-02 08:26:00
On Mon, 2 Jun 1997, era eriksson wrote:

On Sun, 1 Jun 1997 19:13:32 -0700 (PDT),
Dave/WebMaster <ddave(_at_)ddave(_dot_)com> wrote:
 > I'm using duplicating the same recipe to write to two different files. 
 > Can they be combined into a single file?

(Do you mean, a single recipe?)

 > # Write members to MEMBERLIST file
 > :0hc
 > * ^Subject:.*\<(join|subscribe) list\>
 > | formail -zrtxTo >> $PMDIR/joke-l/memberlist.txt
 > 
 > # Write members to NOACK file
 > :0hc
 > * ^Subject:.*\<(join|subscribe) list\>
 > | formail -zrtxTo >> $PMDIR/joke-l/noack.txt

Since you're not doing any locking anyway ;^) you won't lose anything
by doing a tee -a. But while you're at it, you might want to do proper
locking. 

    :0hc:moo.lock
    * ^Subject:.*\<(join|subscribe) list\>
    | formail -zrtxTo | tee -a $PMDIR/joke-l/memberlist.txt \
        >>$PMDIR/joke-l/noack.txt

You should of course use the same lock file when accessing these files
elsewhere in your .procmailrc. 

Or did you have something else in mind? 

Is the lock file going to be necessary for reading or just writing to the 
files?


The matching on the subject line looks a bit sloppy to me; are you
sure you want the wildcard there? 

      * ^Subject: (join|subscribe) list(\>|)

What is your opinion of this expression?


Regards,

Dave/Webmaster

           Join www.cauce.org | Join Joke-L
  Hit SPAMMERS Where It Hurts | Listserv <listserv(_at_)ddave(_dot_)com>

"God grant me the serenity to accept the things I cannot change, 
the courage to change the things I can, and the wisdom to hide 
the bodies of the SPAMMERS that I killed."

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