procmail
[Top] [All Lists]

Re: Recipe assistance...

1997-04-28 11:57:00
Anders Eriksson <Anders(_dot_)C(_dot_)Eriksson(_at_)telia(_dot_)se> writes:
Current Setup:

:0 wc
* ^FROM_DAEMON
* ^TO .*exmh-users.*$
|/usr/local/lib/mh/rcvstore +lists/Exmh-workers -nocreate

...repeated several times for different mailinglists.

The problem:
To get crossposts to appear in every relevant folder i have to use `c` (copy) 
in the recipe. The backside of this is that at the end of the .procmailrc where
 I want my personally addressed mails to be left in the system spool, I also ge
t a copy of every maillist mail. This is currently handled` with a 

:0 w
* ^FROM_DAEMON
|/usr/local/lib/mh/rcvstore +lists/DAEMON -nocreate

A less than perfect solution. (One idea is to forward the mail to /dev/null, b
ut that also catches mail from new maillists without recipes)

What I really want is a conditional indicationg wether there was a `hit` in at
least one of the recipes above. How do I get that?

Whenever procmail delivers to a program or folder, it sets the LASTFOLDER
variable to the name of the program or folder.  Thus, you can simply
check to see whether LASTFOLDER has been set, delivering to /dev/null if
it has.

        :0
        * $ ! ${LASTFOLDER+!}
        /dev/null

If there are recipes with the 'c' flag at the top of your .procmail that
you don't want to be counted against this, then you can unset LASTFOLDER
after them, but before the first of your mailinglist recipes.  To unset
a variable, just give its name without an equals.

        LASTFOLDER


Philip Guenther

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