|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Louis-David Mitterrand (vindex
apartia.org)Date: Wed Feb 06 2002 - 04:09:02 CST
On Mon, Feb 04, 2002 at 03:19:20PM +0100, Jody Harvey wrote:
> I am looking for an EASY and SIMPLE auto responder. I know of procmail and
> gnarwl. Both have a steep learning curve. Any other ones out there?
Here is a vacation prorgam that installs in /etc/procmailrc and is
accessible to all users through an e-mail interface: user sends mail to
himself with "vacation on" as subject and auto-response as body to
activate, and an empty message with "vacation off" to de-activate.
## auto-vacation recipe by Louis-David Mitterrand <ldm
apartia.org>
## BEGIN constants, do not touch
XLOOP=$LOGNAME
$HOST
VAC_MESSAGE=$HOME/.vacation.msg
VAC_CACHE=$HOME/.vacation.cache
VAC_LOCK=$HOME/.vacation.lock
FWD_ADDRESS=$HOME/.fwd.email
NL="
"
## END constants
# test if message is to and from the same address and if suject is
# "vacation on"
:0
* ^TO_\/[-\.a-z_]+
*$ ^From:.*$\MATCH
* ^Subject: *vacation *\/o(ff|n) *$
## make $MATCH lowercase
* MATCH ?? ()\/o(ff|n)
{
ACTION=$MATCH
LOG="ACTION: vacation $ACTION, USER: $LOGNAME, HOME: $HOME $NL"
# whatever the action clear the cache and remove old message
:0c
| rm -f $VAC_MESSAGE $VAC_CACHE
:0
* ACTION ?? on
# deliver
{
:0 bc
| cat > $VAC_MESSAGE
:0 fhw
* Subject:\/.*
| formail -i "Subject: [VACATION ON]$MATCH"
}
:0 fhw
* ACTION ?? off
* Subject:\/.*
| formail -i "Subject: [VACATION OFF]$MATCH"
}
:0
*$? "test -e $VAC_MESSAGE"
{
:0 Whc: $VAC_LOCK
# Perform a quick check to see if the mail was addressed to us
# *$ ^To:.*\<$\LOGNAME\>
*$ ^TO_$\LOGNAME
# Don't reply to daemons and mailinglists
* !^FROM_DAEMON
# Mail loops are evil
*$ !^X-Loop: $XLOOP
| formail -rD 8192 $VAC_CACHE
:0 e # if the name was not in the cache
{
:0 hc
| (formail -rI"Precedence: junk" -A"X-Loop: $XLOOP" ; \
cat $VAC_MESSAGE ) | $SENDMAIL -oi -t
:0 fhw
* Subject:\/.*
| formail -i "Subject: [AUTOREP]$MATCH"
}
}
## EOF
--
THERAMENE: Craint-on de s'égarer sur les traces d'Hercule ?
Quels courages Vénus n'a-t-elle pas domptés !
(Phèdre, J-B Racine, acte 1, scène 1)
-
To unsubscribe, send mail to majordomo
postfix.org with content
(not subject): unsubscribe postfix-users
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]