Vacation at the BIC

Vacation program

This is one simple way to set up an Auto-Reply message, useful while you travel, vacation, or try to avoid your advisor.

To set up the vacation program:

  • With your favourite text editor, create a file called $HOME/.vacation.msg that will contain your auto-reply vacation message. This file should start with the headers below. It’s important to have the headers From/Subject/Precedence with correct values.

From: me@bic.mni.mcgill.ca
Subject: I am on vacation
Precedence: bulk

I am not here.
I shall return.

  • Start a ssh session to the BIC login host, login.bic.mni.mcgill.ca .
  • Initialize the vacation database. Do this before modifying your $HOME/.forward as explained below.

vacation -i

  • On a BIC login terminal run vacation and follow the instructions. If you view’ or edit’ the .vacation.msg or the .forward file, type q’ to move on. Suggested option -r 3` sets the reply delay to 3 days. The default is 1 week. It’s up to you.

vacation -r 3

  • Test your auto-reply!

To turn off the auto-reply, run vacation again, and choose to not enable’ the vacation program. Or simply edit your $HOME/.forward` file and remove the vacation stuff. It should look like:

\me, "|/usr/bin/vacation -a my-other-alias me"

For further details, read the man page: man vacation .

Disclaimer: This method replies to all mail that is not indicated as bulk’, including SPAM! To avoid this, use the procmail` recipe below.

Procmail recipe

A more elegant method is to use procmail , a very powerfull automatic mail processor. This is a bit more involved but it works much better that the vacation program above.

Procmail recipes for a user are defined in the file $HOME/.procmailrc . This file is automatically detected by the mail server so you don’t have to do any thing special, just make sure the recipes are doing what they are supposed to do! Again, read the man pages! apropos procmail will list all the man pages related to procmail . man procmailex is very helpfull in providing quite a few recipes examples and man procmailrc explains the syntax used for the recipes. For a quick start, see the NOTES section at the end of the procmail man page.

You should include the instructions for the auto-reply in your .procmail.rc file AFTER the spamassassin routines, if you use any of the SpamAssassin to weed out spam. Start with HowToBlockSpam to learn about SpamAssassin .

Below, the BIC username is assumed to be bic-user . Substitute you own. Be extremely careful if you cut and paste the following!

<insert your spamassassin stuff and other recipes here>

################################################################
# Vacation thingie. Must be at the end only!
#
SENDMAIL=/usr/lib/sendmail

:0 Whc: .vacation.lock
* !^FROM_DAEMON
* !^X-Loop: bic-user@bic.mni.mcgill.ca
| formail -rD 8192 .vacation.cache
#
# Only run this rule if the last rule didn't match,
# meaning it will only mail each user once.
#
:0 ehc # if the name was not in the cache
| (formail -rA"Precedence: junk" \
-A"X-Loop: bic-user@bic.mni.mcgill.ca" ; \
cat $HOME/.vacation.msg; \
echo "-- "; \
cat $HOME/.sig \
) | $SENDMAIL -oi -t
#
################################################################