PNCE Logo Setting a Vacation Message for Email


Setting a Vacation Message for Email

Sometimes it is useful to have the system generate an automatic reply to anyone sending you email. A case in point is if you wish to inform people emailing you that you are out of town and will be unable to read or reply to email for some period of time, and advise them to other people to contact if they need a more immediate response.

There is an useful program available on PNCE-Unix systems called vacation to do just that. Although the program is not limited to the simple "I will be out of the office" messages described above, that is one of its more common uses and the one we will discuss. For more information on this and other uses of vacation, please read the the OIT Helpdesk page for information setting up vacation components (This page will provide the usser-specific files and commands). Parts of this page are borrowed from their page as well.

Instructions for using Vacation program on PNCE-Unix (Glue) machines

NOTE: At various points in this documentation you will come across the word userid. This should be replaced with your login name on the PNCE-Unix/Glue system.

Preparing to use Vacation

  1. First, log into a PNCE-Unix machine that you have interactive access to. Many research groups have designated login machines which you can use if you are a member of that group, and everyone in the Physics department has access to the machine login.physics.umd.edu. Once logged in, change directory to your incoming mail directory: cd /mail/userid (where userid is your login ID on the PNCE-Unix system).
  2. Once there, run the command: vacation -i to create/initialize the database file (.vacation.db) for vacation. (To avoid annoying people, vacation will normally only send a single message to any given person in any given week. This database file is where it remembers who was sent messages already.)
  3. Next, in the same directory (/mail/userid) place the message you wish people to get automatically in the file .vacation.msg This file should include the mail header (subject line, from line, reply-to line, etc.) at the top of the message, separated from the body of the message by a blank line. See example. You can use any editor (pico, emacs, vi) to create the file.

Vacation is now ready to run on your account, but is not yet turned on. To turn it on you must configure your .forward file.

Turning on vacation for your account

In order to have vacation start to respond to email sent to your account, you will need to configure /mail/userid/.forward to have incoming mail sent to the vacation program as well as to your mailbox as usual.

The file /mail/userid/.forward is used in PNCe-Unix systems to have mail sent to the account userid@physics.umd.edu(or userid@glue.umd.edu) to be processed in a manner different from the default (which is to stick it in your mailbox). Most commonly this is used to have the message forwarded to another account, although in this case we will be using it to send the message to the vacation program as well as sending it to your mailbox.

Most users should not have a .forward file. Use the command ls -al /mail/userid/.forward to check for its existance; if you get a /mail/userid/.forward not found error the file does not exist.

If the file exists, presumably you set it up and know something about .forward files. Because of the complexity what can be done in a .forward file, this document cannot cover this case. Use the following as guidelines as to how you should modify your .forward file, but you are basically on your own. Submit a physhelp request if you have questions. If your .forward file simply contains a single email address to which you are forwarding mail, it is probably wiser to not configure vacation on this system but to instead configure it on the system you forward all your mail to. It is also advisable to make a backup copy of your .forward file, i.e. cp .forward .forward.old to facilitate restoring things to normal after you come back.

I am assuming at this point that you do not have a .forward file based on the discussion of the previous paragraph. In that case, you can simply modify your .forward file to contain the following: There are two ways to create the .forward file that you need:
\userid, "| /usr/ucb/vacation userid"
You can do this in your text editor of choice (e.g. pico, vi, emacs) or on the command line with:
echo '\userid, "| /usr/ucb/vacation userid" ' > .forward
(Note that both types of quotes (single & double) are used in this, and remember to replace userid with your login name on the PNCE-Unix system).

Use the command cat .forward to verify the contents of this file.

Once the .forward file is configured, mail sent to you will go into your mailbox and also cause the message in .vacation.msg to be sent to the sender of the email (but only once to a given email address in a given week).

Turning off vacation program

Once you return from your trip and want to turn off the sending of .vacation.msg to those who email you, you need only return your .forward to its previous setting.

If you did not have a .forward before, you can simply remove it with the command rm /mail/userid/.forward. Or you can just rename it, i.e. mv /mail/userid/.forward /mail/userid/forward.vac. If you rename it, the vacation program will be disabled but if you wish to use it again in the future you need only edit the message file .vacation.msg if necessary and rename the .forward file back, i.e. mv /mail/userid/forward.vac /mail/userid/.forward.

If you had a .forward file before, you just need to restore it to what is was to disable the vacation program. If you made a copy of it, you can just copy that back over it, e.g: cp /mail/userid/.forward.old /mail/userid/.forward.

An example

George Bigboote (login name bigboote wishes to tell people he will be out of communication until 1/1/00 when they email him. So he does the following:

  1. A couple of days before he leaves, he prepares the vacation program:
    ssh login.physics.umd.edu
    login: bigboote
    password:
    
    bigboote> cd /mail/bigboote
    bigboote> vacation -i
    bigboote> pico .vacation.msg
    
  2. He now enters the message he wants sent to people emailing him, e.g.
    From: bigboote@physics.umd.edu (George Bigboote)
    Subject: George Bigboote is out of his office
    
    Hello,
    George Bigboote will be out of his office and unable to read or answer
    email until 1/1/00.  If the matter you are trying to discuss with him is
    urgent, please leave a message with his secretary at (411) 123-4567.
    
    Once he is back he will respond to your email as soon as time permits.
    Thank you,
    
    George Bigboote
    
  3. Just before he leaves his office for his vacation, he activates the vacation program:
    ssh login.physics.umd.edu
    login: bigboote
    password:
    
    bigboote> cd /mail/bigboote
    bigboote> ls -al .forward
    .forward not found
    bigboote> echo '\bigboote, "| /usr/ucb/vacation bigboote" ' >  .forward 
    bigboote> cat .forward
    \bigboote, "| /usr/ucb/vacation bigboote"
    bigboote> logout
    
    (As George was not forwarding his mail before then, he did not have a <.forward file before this.)
  4. George enjoys a relaxing vacation knowing that anyone emailing him will be informed of his absence.
  5. When George gets back, he disables the vacation program as follows:
    ssh login.physics.umd.edu
    login: bigboote
    password:
    
    bigboote> cd /mail/bigboote
    bigboote> mv .forward forward.vac
    bigboote> logout
    
    and then catches up on his mail.
  6. Several months later George is off again, so he simply updates his .vacation.msg and then copies his vacation copy of the .forwad back, eg
    ssh login.physics.umd.edu
    login: bigboote
    password:
    
    bigboote> cd /mail/bigboote
    bigboote> mv forward.vac .forward
    bigboote> logout
    



University of Maryland Signature     Physics Home | PNCE Info | UNIX Info | PC Info | System Info | POWL Firstaider | E-Mail

This page is maintained by the Physics Web Managers:
For Content Questions contact the WebEditor.
For Technical Questions contact the WebTech.