procmail vacation messages

Michael L Torrie torriem at chem.byu.edu
Thu Jul 13 16:42:30 MDT 2006


On Tue, 2006-07-11 at 16:36 -0600, Hans Fugal wrote:
> man procmailex
> 
>     A  more  complicated  autoreply  recipe  that implements the functional
>     equivalent of the well known vacation(1) program.  This recipe is based
>     on  the  same  principles as the last one (prevent `ringing' mail).  In
>     addition to that however, it maintains a vacation database by  extract-
>     ing  the name of the sender and inserting it in the vacation.cache file
>     if the name was new (the vacation.cache file is maintained  by  formail
>     which will make sure that it always contains the most recent names, the
>     size of the file is limited to a maximum of approximately 8192  bytes).
>     If the name was new, an autoreply will be sent.


Thanks.  You rock! :)

Michael


> 
>     As  you  can  see, the following recipe has comments between the condi-
>     tions.  This is allowed.  Do not put comments on the  same  line  as  a
>     condition though.
> 
> 	    SHELL=/bin/sh    # for other shells, this might need adjustment
> 
> 	    :0 Whc: vacation.lock
> 	    # Perform a quick check to see if the mail was addressed to us
> 	    * $^To:.*\<$\LOGNAME\>
> 	    # Don't reply to daemons and mailinglists
> 	    * !^FROM_DAEMON
> 	    # Mail loops are evil
> 	    * !^X-Loop: your at own.mail.address
> 	    | formail -rD 8192 vacation.cache
> 
> 	    :0 ehc         # if the name was not in the cache
> 	    | (formail -rI"Precedence: junk" \
> 		    -A"X-Loop: your at own.mail.address" ; \
> 		echo "I received your mail,"; \
> 		echo "but I won't be back until Monday."; \
> 		echo "-- "; cat $HOME/.signature \
> 		) | $SENDMAIL -oi -t
> 
> /*
> PLUG: http://plug.org, #utah on irc.freenode.net
> Unsubscribe: http://plug.org/mailman/options/plug
> Don't fear the penguin.
> */



More information about the PLUG mailing list