vacation Command

Purpose

Returns a message to the sender that the mail recipient is on vacation.

Syntax

vacation [ { -I | User } ] | [ { -f Number [ Unit ] | User } ]

Description

The vacation command returns a message to the sender of a mail message to notify the sender that the recipient is on vacation. The intended use is in a $HOME/.forward file that allows messages to come to you while also sending a message back to the sender.
Note: Sendmail version 8.9.3 and subsequent releases have a security enhancement that will ignore the .forward file if either of the following conditions exist:
  • The .forward file has group or world writeable permissions
  • Any of .forward file's parent directories have group or world writable permissions
If you think that the vacation program is not working because the .forward file is being ignored, check the permissions. If you must have group or world writeable permissions on any of the parent directories of the .forward file, then set the DontBlameSendmail option in the sendmail configuration file with the appropriate values.

The vacation command expects a $HOME/.vacation.msg file containing a message to be sent back to each sender. If this file does not exist, the vacation command looks for /usr/share/lib/vacation.def, a systemwide default vacation message file. It should be an entire message, including any desired headers, such as From or Subject. By default, this message is sent only once a week to each person who sends mail to you. Use the -f flag to change the frequency intervals at which the message is sent. The names of the people who send messages are kept in the files $HOME/.vacation.pag and $HOME/.vacation.dir. These files are created when the vacation command is initialized for your user ID using the -I (uppercase i) flag.

If the -I flag is not specified, the vacation command reads the first line from the standard input for a From line to determine the sender. If no text is available from standard input, the command returns an error message. All properly formatted incoming mail should have a From line. No message is sent if the From header line indicates that the message is from Postmaster, MAILER-DAEMON, or if the initial From line includes the string-REQUEST@ or if a Precedence: bulk or Precedence: junk line is included in the header.

Flags

Item Description
-I Initializes the $HOME/.vacation.pag and $HOME/.vacation.dir files. Execute the vacation command using this flag before you modify your $HOME/.forward file.
-fNumber [Unit ] Specifies the frequency interval at which the vacation message is sent. The Number parameter is an integer value and the Unit parameter specifies a time unit. The Unit parameter can be one of the following:
s
Seconds
m
Minutes
h
Hours
d
Days
w
Weeks
Note: The -f flag cannot be used with the -I flag.

Examples

  1. Before you use the vacation command to return a message to the sender saying that you are on vacation, you must initialize the $HOME/.vacation.pag and $HOME/.vacation.dir files. To initialize these files, type:

    vacation  -I

  2. Modify the .forward file. For example, Mark types the following statement in the .forward file:
    mark,|"/usr/bin/vacation mark"
    The sender receives the message that is in the $HOME/.vacation.msg file, or if the file does not exist, the default message found in the /usr/share/lib/vacation.def file. If neither of these files exist, no automatic replies are sent to the sender of the mail message and no error message is generated. If either of these files exist, the sender receives one vacation message from mark per week, regardless of how many messages are sent to mark from the sender.
  3. If the following entry is contained in your .forward file,
    mark, |"/usr/bin/vacation -f10d mark"
    The sender receives one vacation message from mark every ten days, regardless of how many messages are sent to mark from the sender.
  4. To create a vacation message that is different from the default vacation message, create the file $HOME/.vacation.msg and add your message to this file. The following is an example of a vacation message:
    From: mark@odin.valhalla (Mark Smith)
    Subject: I am on vacation.
    Delivered-By-The-Graces-Of: the Vacation program
    I am on vacation until October 1. If you have something urgent, 
    please contact Jim Terry <terry@zeus.valhalla>.
       --mark
  5. To cancel the vacation message, remove the .forward file, .vacation.dir file, .vacation.pag file, and .vacation.msg file from your $HOME (login) directory:
    rm .forward .vacation.dir .vacation.pag .vacation.msg

Files

Item Description
$HOME/.forward Contains the names of people who you want your mail to be forwarded to.
/usr/share/lib/vacation.def Contains the systemwide default vacation message.
$HOME/.vacation.dir Contains the names of people who have sent mail to you while the vacation command was being used.
$HOME/.vacation.msg Contains your personalized vacation message.
$HOME/.vacation.pag Contains the names of people who have sent mail to you while the vacation command was being used.
/usr/bin/vacation Contains the vacation command.