On Sat, 4 Jul 1998, era eriksson wrote:
The normal vacation(1) program found on most systems doesn't let you
include the recipient's name in your reply text anywhere, no. Is that
what you want?
Yes That is what I want.
However, Procmail does let you customize every part of the
autoresponse because you're free to use whatever shell commands you
have access to (including your own Perl or awk scripts) to construct
the reply. Here's a simplistic version which will replace the literal
string $SUBJECT in your $HOME/.vacation.msg with the original subject,
and $YOU with the correspondent's full name, if available (otherwise
usually her or his e-mail address).
Where do I put the variable $YOU, is it the message text?
like say Dear $YOU, ?
The grabbing of YOU is simplistic and not very elegant but this should
at least hopefully work as a nudge in the right direction. (The rest
of the recipe is more or less something I used myself at some point.)
ME=lex4nm1(_at_)unix(_dot_)ccc(_dot_)nottingham(_dot_)ac(_dot_)uk
YOU=`formail -zxFrom: | sed -e 's/\([^<]*\)<[^<>]>[ ]*$/\1/'`
:0whc:vacation.lock
* $ ^TO($\ME)\>
* ! ^FROM_DAEMON
* ! $ ^X-Loop: $\ME
* ? test -r $HOME/.vacation.msg
* ! ? formail -rD 8192 $HOME/procmail/vacation.cache
* ^Subject:[ ]*(\<*Re:?)*[ ]*\/([^r :]|r[^e]|re[^: ])?.*
| ( formail -r -A "Precedence: junk" -A "X-Loop: $ME" \
-I "From: Natu Mwamba (autoresponder) <$ME>" \
-I "Subject: Automatic reply Re: $MATCH" ; \
sed -e 's/\$SUBJECT/'"$MATCH"/ -e 's/\$YOU/"$YOU"/ $HOME/.vacation.msg ) \
| $SENDMAIL $SENDMAILFLAGS -t
The YOU grabber assumes that the original From: header looks like
Where do I put this script, do I have to create file and invoke a command
to execute it or do I name this file as procmail?
I do appreciate your help.
Regards,
Natu.