Subject: AutoReply Recipie for Procmail

From: Mark Anderson <[email-masked]>
Date: Fri, 16 Sep 1994 09:16:03 -0700 (PDT)

Hello!

I'm try to figure out a simple but effective autoreply recipie for 
procmail that will allow me to do the following.

When a key word is sent to me in the body of the message, procmail
generates an autoreply with an appropriate Subject: header of choice and
includes the matching pre-determined file stored in my home directory. 

Also, it would be nice to have a log kept of what file was sent to who 
and when.

In this recipie, there should also be safeguards against bouncing mail.

For example, if the following message is sent:

send info

Then procmail would autoreply with the subject header  Subject:  INFO
and include the file:  home/mydirectory/info

Finally, if there are multiple files that might be requested, can all of 
the files be included in the single recipie, or do I have to make a 
separate one for each?

ie.  if word, then file
     if 2nd word, then 2nd file
     if 3rd word, then 3rd file

Thank you very much if you could provide me with the answer to this.

--
Mark Anderson   [email-masked]

---

From: Adam Shostack <[email-masked]>
Date: Fri, 16 Sep 94 12:58:54 EDT

You wrote:

| I'm try to figure out a simple but effective autoreply recipie for 
| procmail that will allow me to do the following.
| 
| When a key word is sent to me in the body of the message, procmail
| generates an autoreply with an appropriate Subject: header of choice and
| includes the matching pre-determined file stored in my home directory. 
| 
| Also, it would be nice to have a log kept of what file was sent to who 
| and when.
| 
| In this recipie, there should also be safeguards against bouncing mail.
| 
| For example, if the following message is sent:
| 
| send info
| 
| Then procmail would autoreply with the subject header  Subject:  INFO
| and include the file:  home/mydirectory/info
|
| Finally, if there are multiple files that might be requested, can all of 
| the files be included in the single recipie, or do I have to make a 
| separate one for each?

I haven't gotten around to creating multiple file sends, but this will
send files in .outbound/ and log what is sent. 

:0 
* ^Subject: SEND FILE [0-9a-z][-_/0-9a-z.]+$
* !^Subject:.*[ /.]\.
* !^FROM_DAEMON
{
  FILE=`sed -n -e '/Subject:/s/.* //p' -e '/^$/q'`

  :0c 
  | (formail -rt -A"Precedence: junk";\
     cat $HOME/.outbound/$FILE) | $SENDMAIL -t

  :0: 
  $MAILDIR/.log
}