[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sendmail: auto-reply



On Mon, 13 Dec 1999, Iñaki Martínez wrote:
>Kaixo!!!
>
> I need when a e-mail arrives to an account, automagically sendmail sends a
>mail to the sender of that mail with a text (always the same text).
>
>How do i made this???
>
> Using alias????
> Using .forward?????

Put the following into the .procmailrc for the user.  Note that it comes from
the procmailex man page...
SHELL=/bin/sh
 
: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: ${LOGNAME}@your_system_here
| formail -rD 8192 vacation.cache
 
:0 ehc         # if the name was not in the cache
| (formail -rA"Precedence: junk" \
-A"X-Loop: $LOGNAME@your_system_here" -i"Subject: $LOGNAME is away"; \
cat $HOME/vacation.msg ; \
cat $HOME/.signature 2>/dev/null\
) | $SENDMAIL -oi -t

-- 
The ultimate result is that some innovations that would truly benefit
consumers never occur for the sole reason that they do not coincide with
Microsoft's self-interest.
-- Judge Thomas Penfield Jackson, U.S. District Judge


Reply to: