procmail
[Top] [All Lists]

Re: Procmail question using {}

1995-11-29 19:50:15
Soren,
Wow -- your response did the trick. Instantly!
        A) We didn't know to look in procmailex -- there were plenty
           of examples there to follow, but,
        B) We didn't even need those examples because yours was a good start:

Thanks for your quick help -- we appreciate it. {We noticed all the 
examples in the procmailex manpage and the one you gave used :0 so we
many not even need the :2 below (to specify that there are two conditions),
but, this works now thanks to you.}

John Gianni
Sr. Program Manager
Cadence Design Systems, Inc.
San Jose, California
http://www.cadence.com   comp.cad.cadence   comp.lang.verilog


------< cut here for test solution >------
From: James Lee <jml>
To: jjg
Subject: ~/.procmailrc
#----------------------------------------------------------------------------
: 2 w
^Subject:.*test123.*
!Re:
{
:0c
|(formail -r ;echo "The smiley 1 of the day is";smiley) | $SENDMAIL -t
:0
|(formail -r ;echo "The smiley 2 of the day is";smiley) | $SENDMAIL -t
}
#----------------------------------------------------------------------------
-- End of excerpt from James Lee

On Nov 29,  6:28pm, Soren Dayton wrote:
Subject: Re: Procmail question using {}
You asked:

Do you have any examples using the curly braces in Procmail
version "v3.10 1994/10/31"? We don't seem to know the answer here at
Cadence. Maybe you folks can help?
 
 sure.  Lots of them.  Check out the procmailex man page.  

John's user said:
 
We want to automatically filter email and do multiple actions with it. 
We can do it using the "c" option (carbon copy to another filter recipe), 
but, we are trying to do it using just one filter recipe for maximum 
efficiency.

      Well, the way that _I_ would do it would be to:

      :0 Hc
      * ^Subject:.*test
      * ! ^Subject: *Re:
      | formail ....

        :0 Ac
        | formail ....

etc.
 
Apparently procmail will allow curly braces (man procmailrc, search for "}")
in the filtering recipe.

      Yup
 
Here is my test example which should reply to the sender with a
smiley-of-the-day twice:

#----------------------------------------------------------------------------
# This is what I am trying to get to work (two actions within one recipe):
: 2 w
^Subject:.*test.*
!Re:
{
|(formail -r ;echo "The smiley 1 of the day is";smiley) | $SENDMAIL -t
|(formail -r ;echo "The smiley 2 of the day is";smiley) | $SENDMAIL -t
}

      the problem that they are having is that they are thinking that the
braces deal with actions.  They do not.  They group recipes under
certain conditions.

Soren
-- End of excerpt from Soren Dayton


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