Subject: Re: question about "vacation" simulation

From: Richard Kooijman <[email-masked]>
Date: Sat, 5 Feb 1994 23:31:39 +0100 (MET)

On Sat, 5 Feb 1994, Craig Cockburn wrote:

> So if I was wanting to send a file as an autoreply, I'd
> want something like this:
> 
> |(formail -r; cat reply.txt) |sendmail -t
> 
> would this work?

I use the following recipe. A slightly modified version of the example in
procmailex.5. Might be to costly for you since it checks the enabling of
this vacation feature by checking a file's contents.  You might want to
(en/dis)able it by (un)commenting or by setting a variable at the top. All
files are defined by variables. 

Richard. 
--------------------------------------- 

VACATION=$MAILDIR/vacation # on vacation? 
VACATIONMSG=$MAILDIR/vacation.msg # the vacation reply 
ALREADYSENT=$MAILDIR/vacation.dat # sender database

# Vacation mail handling 
:0 
* !? egrep -is -e "^home" $VACATION 
* !^FROM_DAEMON 
{
    FROM="`formail -rx To:`"

    :0 ch:  # the lockfile is important
    * !? fgrep -s -e "$FROM" $ALREADYSENT
    | echo $FROM >> $ALREADYSENT; \
        (formail -rA "Precedence: notification" ;\
        cat $VACATIONMSG) | $SENDMAIL -t
}