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 <l...@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 majo...@postfix.org with content
(not subject): unsubscribe postfix-users
I've been some days out of my office, that's why I'm answering so late ;-)
>
> 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?
Some weeks ago, I wrote a toolkit called "Tequila" which implements (beside
others) a module for autoresponding (including validation period checking
and forwarding).
Have a look at http://www.holgilein.de/coolprox/tequila
At present, there's a german and a english version available. Other
languages will follow on demand. Screenshots are also on the page.
The autoresponder implements the following properties:
* Fully controllable by the user via the web-interface.
* Forces the input of the absence period ("From" -> "Until").
* Separate turn on/off for the absent message.
* Separate turn on/off for the forward address.
* Put tags into your response, if you like make the the
absence period and/or the forwarding address visible to the
recepient.
* The services are automatically turned on/off by a nightly cronjob
depending on the actual day is within the range of the absence
period of a user.
Requirements:
The autoresponder uses Tequila's directory structure, which in turn is
used by Postfix and vm-pop3d (a popper without the need for unix
accounts).
Incoming mails will be delivered to
/var/spool/mail/<DOMAIN>/<USER> like
/var/spool/mail/dachser.dpd.de/holger.jahn
There's a vacation dir:
/var/spool/mail/dachser.dpd.de/vacation/
and the autoresponder reacts on the existence of some per-user files:
/var/spool/mail/dachser.dpd.de/vacation/holger.jahn.vacation
/var/spool/mail/dachser.dpd.de/vacation/holger.jahn.forward
.vacation contains the message to reply, .forward the address(es) to
forward the emails to.
But these files are created/removed by Tequila on demand.
So, if it's acceptable for you to change some dir structures, you'll
probably find in Tequila what you're looking for.
Greetings from Munich,
Holger.