procmail
[Top] [All Lists]

Re: Running user procmailrc

2004-03-22 22:02:23
On Mon, Mar 22, 2004 at 10:33:58PM -0600, Alex S Moore wrote:
On Mon, 2004-03-22 at 21:30, Scott Wiersdorf wrote:
Normally, you'd just remove the recipe that delivers to $DEFAULT and
let procmail continue on its merry way, into the .procmailrc files. If
not .procmailrc file is found, it will deliver to default anyway.


Thanks for the reply Scott.  Yes, that makes sense and confirms my
suspicions.  However, I need to add some filtering and want that done on
a per user basis.

You can still add per-user filters in the .procmailrc files, just
don't deliver to $DEFAULT in the main procmailrc file. Re-order your
recipes (this may also require rewriting some recipes, depending on
your logic) so that the delivery is implicit when the message "falls
off the end" of the procmailrc file.

This way, users w/o .procmailrc files will have normal delivery (i.e.,
mail is always delivered to $DEFAULT in the absence of another
delivering recipe), while those who do have .procmailrc files will
have the mail processed by them.

Am I misunderstanding your question? Here's some pedantry (forgive
me please):

How Procmail Fits into Local Mail Delivery:

- mail message is received by MTA (and MTA determines mail is to be
  delivered locally)
- MTA hands message off to the LDA (procmail)
- procmail looks for "global" procmailrc (usually /etc/procmailrc or
  /usr/local/etc/procmailrc)
- if global procmailrc file exists, the message is passed through each
  recipe in the file until a delivering recipe is found, or the message
  "falls off the end" of the file.
  - if a delivering recipe is found, procmail delivers message and
    exits [STOP]
  - if no delivering recipes are found, message continues on
- procmail looks for .procmailrc files (we're ignoring the procmailrcs
  directory for simplicity)
- if .procmailrc file exists, the message is passed through each
  recipe in the file until a delivering recipe is found, or the
  message "falls off the end" of the file.
  - if a delivering recipe is found, procmail delivers message and
    exits [STOP]
  - if no delivering recipe is found, procmail delivers message to
    $DEFAULT and exits [STOP]

Again, forgive me if you knew this, I'm just having a hard time
understanding where you're coming from.

Scott
-- 
Scott Wiersdorf
scott(_at_)perlcode(_dot_)org

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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