On Mon, 3 Dec 2001, Mark Neidorff wrote:

> Hi folks,
> A (simple?) procmail question.
>
> I have /etc/procmailrc send email to each user on my system and it is
> simple and works........most of the time.
> When an email comes addressed to 2 users on the system, it is delivered to
> the first one and not to the second (makes sense now that I think of how
> procmail works).    What is a better way to write these recipes?
>
> :0:
> * ^TO_.user1
> !user1
> :0:
> * ^TO_.user2
> !user2

There are two kinds of recipes in procmail: delivering recipes and
non-delivering recipes.  When a delivering recipe matches and is executed,
procmail exits.

What you want to do is to tell procmail to deliver a copy and then keep
looking for other matches.  You use the "c" modifier for this.  Try:

:0 c
* ^TO_.user1
!user1
:0 c
* ^TO_.user2
!user2

Also note that since procmail is forwarding the email, not writing to
logfiles, you don't need the lockfiles you've specified with the second :
on each recipe.

Now that I've told you what you've asked, I'll say that you're probably
doing something wrong to even need this script, unless you are trying to
redirect phoney or aliased user names to real user names.

If this is not the case, and the to: will match the real user name, the
following *UNTESTED* recipe, or something like it, may work so you only
need one recipe, and you don't need to touch it when you add users:

:0
* ^TO_.\/(.*)$
!$MATCH


-------------------------------------------------------------------
DDDD   David Kramer                           http://thekramers.net
DK KD
DKK D  Gravity is a harsh mistress!
DK KD                                                    - The Tick
DDDD



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to