procmail
[Top] [All Lists]

Procmail question using {}

1995-11-29 16:00:42
procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de,

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?

Thanks,
John Gianni
Cadence Design Systems, Inc. (software for designing chips/boards)
http://www.cadence.com

--- Forwarded mail from jjg (John Gianni)

From: jjg (John Gianni)
Date: Wed, 29 Nov 1995 14:19:33 -0800
To: chino, dlaner, donnelly, dori, gene, jeg, jessie, jonl, kent, kpischke,
        lindam, lowe, mtl, pdh, repeta, robg, scottc, shaner, sohrab, stevek,
        wills, wsm
Subject: Procmail question using {}
Cc: jjg, jml, fabio, slr, dang


procmailusers,
Do you have an example of the use of curly-braces nested filtering actions {}?
No need to reply if you don't. But, please reply if you do. 

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.

Thanks,
John

--- Forwarded mail from James Lee <jml>
Date: Wed, 29 Nov 1995 13:44:43 -0800
From: James Lee <jml>
To: alastair, perry
Subject: Procmail question using {}
Cc: jjg, jml

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

I am trying to get multiple actions using this method. I can find no
examples of this in John's procmail archives, or in the examples shipped
with procmail or in the FAQ located at:
http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html

Do you know how to get this procmailrc-manpage-documented syntax to work?

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

#----------------------------------------------------------------------------
# This works:
# :    = start a recipe
# 2    = there will be two conditions
# w    = wait for the filter to work before processing the next email
# c    = Oh, by the way, continue on to the next condition when finished.
# ^Subject:.*test.* = Condition 1 - filter messages that have "test" in Subject
# !Re: = but, (Condition 2) that don't have a "Re:" line (don't filter replies)
# formail -r = builds a reply header to the oringinal person
# "echo " sends whatever you want to stdout which goes to the email body,
# smiley = run the "smiley" program on my machine
# "sendmail -t" puts the header and body together and sends it off.
: 2 wc
^Subject:.*test.*
!Re:
|(formail -r ;echo "The smiley 1 of the day is";smiley) | $SENDMAIL -t
# The carbon-copy would then be passed to the next recipe for the next
# action.
#----------------------------------------------------------------------------
# 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
}
#----------------------------------------------------------------------------

James 
---End of forwarded mail from James Lee <jml>


---End of forwarded mail from jjg (John Gianni)

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