procmail
[Top] [All Lists]

Re: Combining Recipes

1997-06-02 03:24:00
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? 

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

/* era */

Please don't Cc: me when writing to the list. Thanks.

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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