Subject: newbie question

From: [email-masked] (Shinu Gupta)
Date: Fri, 24 Mar 95 16:52:23 EST

Hi,

I am rather new to procmail. I have a small question. I am trying to write a
small recipe which is used to auto reply to sender's requests. Eg:

I want to have the following commands:

send aaaa
send bbbb
send cccc
send dddd

Each command sends back (automatically) some files, say aaaa.txt, bbbb.txt,
cccc.txt and dddd.txt respectively.

If user enters two commands in the mail body, he receives two replies with 
respective files.

In our .procmailrc we have 4 rules, one for each one of the commands. This seems
to work fine. Now at the end I want to have a recipe that can send back an 
error to the sender, if and oly if, none of the commands are there in the
mail body. If I stick this recipe at the end, then the sender ALWAYS receives
the error message, even if one of the valid commds is there.

Please help !!!!!!!!!!!

Shinu

---

From: [email-masked] (David W. Tamkin)
Date: Fri, 24 Mar 1995 17:03:35 -0600 (CST)

Shinu Gupta asked,

| In our .procmailrc we have 4 rules, one for each one of the commands. This
| seems to work fine. Now at the end I want to have a recipe that can send
| back an error to the sender, if and oly if, none of the commands are there
| in the mail body. If I stick this recipe at the end, then the sender ALWAYS
| receives the error message, even if one of the valid commds is there.

Here's a way that Stephen van den Berg posted when someone asked a similar
question:

 :0
 * $ ${LASTFOLDER:+!}
 | error_routine

If any previous recipe that would have been delivering except that it had
a `c' flag has been executed, $LASTFOLDER will be non-empty and that recipe
will be skipped; otherwise $LASTFOLDER will be null (perhaps even unset)
and the condition will match, so error_routine will run.

Of course, you'll still have to dispose of mail that did contain a valid
command, so you'll need something else after that.  If you're just going
to delete mail that contained any valid commands, this might be better:

  :0b
  * ! $ ${LASTFOLDER:+!}
  /dev/null

  :0
  | error_routine