Thursday, 09 February 2006 02:58

Setting up Vacation


Vacation is a program which can automatically respond to e-mail while you're away for an extended time. All e-mail sent to your account is saved to your account, but each individual emailing you will be given notification that you are out.  Vacation keeps track of incoming addresses, so it will only respond once per week (by default) and not bother senders with continual notices.


There are two (three, if you are using Procmail) easy steps needed to set up the vacation program:

  1. Initialize Vacation

    Run '/usr/bin/vacation -i' on to initialize the database vacation will use to track who has sent mail during your absence.

  2. Setup Vacation.


    Once vacation has been initialized, run '/usr/bin/vacation' without any flags and the program will run in interactive mode.  Just follow the prompts to create or edit your vacation message (kept in ~/.vacation.msg).  If this file already exists, you will be asked if you wish to edit it.  If it does not exist, it will be created for you.  Following is an example message:


    From: John Dough <>
    Subject: I am out of the office.
    Precedence: bulk

    I have received your message about $SUBJECT.

    I'm off on a 33-year sabbatical to go rock climbing around the
    world. My employer, the School of Computing at the University of
    Utah, was kind enough to foot the bill. I will be back just in
    time to collect my retirement benefits, so I will get back to your
    email then.

    See you at the crags!


    You can write any type of message you would like. If you use the variable "$SUBJECT" in your message, and it will replace this token with the subject of the received message.

    The last prompt will ask you if you wish to enable the vacation program.  If you are not using Procmail features of our mail server, you can simply select "Yes" and a ~/.forward file will be created for you, enabling Vacation.  You can also select "No" if you are not ready and re-run '/usr/bin/vacation' at any time after to enable it.

    If you are using Procmail to manage your email, you should select "No" and move to the next step in this guide.  Otherwise, you're all done.

  3.  Prepare Your .procmailrc File  (ONLY REQUIRED IF USING PROCMAIL!)


    If you are using Procmail, setting up your .procmailrc must be done by hand, adding a recipe to your ~/.procmailrc. The advantage to Procmail is that you can apply your anti-spam and/or refiling rules first and only auto-respond to those messages you wish. An example recipe would be:


    # Send Mail Message through the vacation program
    :0 c:
    | /usr/bin/vacation <username>



Once you have enabled Vacation through the '/usr/bin/vacation' program, or via Procmail, Vacation is set up and you are ready to go. Sending e-mail to your account from an outside account, can be used to verify that vacation is working properly.


Disabling Vacation


Once you have returned, you will need to disable Vacation to prevent further auto-replies to senders.  


If you have enabled Vacation through it's prompts, creating a .forward file in your home directory, you can simply delete ~/.forward and Vacation is disabled.


If you have enabled Vacation through Procmail, you will need to comment out or remove your vacation recipe in your ~/.procmailrc file.