procmail
[Top] [All Lists]

Re: Non-Delivered recipe -> Delivered?

1996-12-11 17:47:48
On Wed, 11 Dec 1996, Tim wrote:

    > Reading the PROCMAILRC MAN page, it tells me the difference between a 
    > "delivering" and a "non-delivering" recipe.  I know, and the MAN page 
    > tells me how, to make a delivering recipe act like a non-delivering one 
    > by using the 'c' flag.  What I want to do is make a non-delivering 
    > recipe act like a delivering one:
    > 
    > I have a recipe as such:
    > 
    >   :0 fhw
    >   * ^Return-Path.*procmail
    >   | $FORMAIL -i "Reply-To: 
procmail(_at_)Informatik(_dot_)rwth-aachen(_dot_)de"
    > 
    > The problem is is I want PROCMAIL to stop filtering after this email and 
    > just stick it in my mailbox.  I could do it like this, right?
    > 
    >   :0 fhw
    >   * ^Return-Path.*procmail
    >   | $FORMAIL -i "Reply-To: 
procmail(_at_)Informatik(_dot_)rwth-aachen(_dot_)de"
    > 
    >   :0
    >   * ^Return-Path.*procmail
    >   $ORGMAIL
    > 
    > but this seems a bit superfluous.  Would something like this work?
    > 
    >   :0
    >   * ^Return-Path.*procmail
    >   {
    >           DELIVERED=YES
    >           :0 fhw
    >           | $FORMAIL -i "Reply-To: 
procmail(_at_)Informatik(_dot_)rwth-aachen(_dot_)de"
    >   }
    > 
    > or am I lost on the concept of "DELIVERED=YES"?  Or should the 
    > "DELIVERED=YES" be placed after the beginning of the nested recipe (i.e., 
    > after the ":0 fhw" line))?  Or should it be done in a totally different 
    > manner?  Thanks!

Here is how I would write it:

    :0 fh       # install correct Reply-To for procmail list email
    * ^Return-Path:.*procmail
    | formail -I "Reply-To: procmail(_at_)Informatik(_dot_)rwth-aachen(_dot_)de"
    :0 a        # now file it
    $DEFAULT

The 'a' flag says do the recipe only if the preceding recipe's
action was successful.

As for your "DELIVERED=yes" solution, you are actually doing the
opposite of what you want.  When you set the variable DELIVERED that
way, you are telling procmail that the mail is to be considered as
having already been delivered, and that procmail should not bother
filing it by default.

So in the recipe above, when you set DELIVERED, you told procmail to
NOT file the mail.

___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

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