procmail
[Top] [All Lists]

filter of autoresponder

1998-02-10 02:33:29
I get a procmail recipe showed below and setup a autoresponder. 
If someone send it a email with a subject 'send filename', my 
autoresponder can reply sender with text of 'filename'. But it 
cannot check if 'filename' is existent in my HOME directory and 
if the subject line is valid command.
How can I modify the recipe and add a branch handle ?
Thanks.

.forward

"|IFS=' ' && exec /usr/bin/procmail || exit 75 #myname"

.procmailrc

:0 c
* !^X-Loop: myname(_at_)site(_dot_)com
* !^Subject:.*Re:
* !^FROM_DAEMON
* ^Subject:.*send
{
  MAILDIR=$HOME   # chdir to the fileserver directory

  :0 h             # extract the requested filename(s)
  FILES=| sed -n -e 's/^Subject:.*send \(.*\)/\1/p' | (tr -d '/')

  :0 f                # reverse the mailheader
  | formail -rA "X-Loop: myname(_at_)site(_dot_)com"

  :0
  | (cat; cat $FILES) | $SENDMAIL -oi -t
           
}


<Prev in Thread] Current Thread [Next in Thread>
  • filter of autoresponder, Johnny Xu <=