I developed a script to support holiday messages. It appears to work very
nicely with one important exception (that I expected): if a person on
holiday sends a message to another person on holiday, they get an infinite
loop of holiday notifications to each other (thank God for quota
enforcement!)
Anyway, below is the guts of my script, which is pretty basic. So my
question to y'all is, what logic do other "holiday" algorithms employ to
prevent such looping? Could I make a more judicial choice of environment
variables to use for the sender and recipient? (I went to some length in
research to configure things so that a holiday message could be properly
"replied" to, but perhaps disabling this is inevitable?)
Thanks in advance!
Dave
-------------------------------------------------
#!/bin/sh
#
# holiday.sh
#
# Dave Kitabjian, 6/11/99
# [EMAIL PROTECTED]
#
# This script should be entered into a user's .qmail file as |holiday.sh
# It depends on the SENDER environment variable, provided by qmail-local;
# HOME and HOST are also used.
# It permits delivery and replies with a message found in .holiday
#
# Should be able to use $USER @ $HOST, but we using a single-uid
# configuration of Qmail. HOST is okay, but USER must be pulled from
# home directory:
# (We don't use $LOCAL since we don't know where the username ends and
# the domain begins without hacking $HOME)
QMAILUSER=`basename $HOME` # used by qmail-inject to set "From:" header
QMAILHOST=$HOST # used by qmail-inject to set "From:" header
export QMAILUSER
export QMAILHOST
qmail-inject $SENDER <"$HOME/.holiday"
exit 0
-------------------------------------------------