vacation - reply to incoming e-mail with an ``I am not here'' message


vacation -i [-d] [-f db] [-r interval] [-x] vacation -x [-d] [-f db] [-r interval] vacation -l [-d] [-f db] vacation [[-a alias] ...] [-d] [-f db] [-m msg] [-r interval] [login]


vacation processes RFC-2822 compliant messages fed to its standard input and may reply with a message telling the originator of the incoming message that you are currently not reading your mail. The intended use is as a pipe command in a .forward file.


Available options:

Treat alias as an alias for the user running vacation. There can be multiple instances of ``-a alias'' given on the command line and each alias will be added to an internal list of names. These should probably be given as fully qualified addresses. This silly trick is necessary if you subscribe to any mailing lists handled by broken mailing list software (eg. Lsoft's LISTSERV as of the last inspection) that doesn't include a proper ``Precedence:'' header as described below.

Turn on debugging. This flag causes informtaional and error messages to be printed to stderr as well as logged. Never use this option on the invocation in your ~/.forward file!

-f db
Use db as the recent recipients database file instead of the default ~/.vacation.db.

(Re-)Initialize the recent recipients database file. It should be used before you modify your ~/.forward file, and it must never be used on the invocation in your ~/.forward file. Except when listing the contents the database will always be created if it does not exist so this option is only necessary if you want to clear an existing database and perhaps set a new reply interval.

List the current contents of recent recipients database file.

-m msg
Use msg as the reply message contents file instead of the default ~/.vacation.msg.

Set the reply interval to interval days. This value is stored in the ~/.vacation.db file and is usually used with the -i option. The default reply interval is one week. An interval of zero (``0'') is not allowed as that would mean a reply would be sent to each message, which could accidentally cause a mail loop between another less carefully programmed autoresponder. An interval of ``infinite'' will never send more than one reply.

Reads a list of addresses from standard input, one per line (ignoring blank lines and lines that begin with a ``#'' character), and adds them to the recent recipients database. Mail coming from these excluded addresses will not ever get a reply. ``@domain''.

Theory of Operation

No message will be sent unless login (or the invoking user's name), or an alias supplied using the -a option, is part of either the ``To:'' or ``Cc:'' headers of the mail.

No messages from ``-OUTGOING'', ``-RELAY'', ``LISTSERV'', ``-REQUEST'', ``MAILER'', or ``MAILER-DAEMON'' will be replied to (where these strings are case insensitive suffixes of the base mailbox name for the sender or originator address).

Finally, and most importantly, no notification is sent if a ``Precedence:'' header is found that contains the value ``bulk'', ``list'', or ``junk''.

vacation expects to find a file called .vacation.msg, in your home directory (or whatever file was specified with -m), containing an RFC-2822 compliant message to be sent back in response to an incoming message. It must be an entire message, including headers, but without recipient headers, and especially without the UNIX mailbox ``From_'' header). The recipient address(es) will be supplied in a ``to:'' header that will be automatically prepended to the message. Any occurrence of the string ``$SUBJECT'' will be replaced by the content of the ``subject:'' header from the message being read on the standard input. A ``Precedence: bulk'' header is also automatically prepended to the message.

The reply is sent to the address(es) given in the ``reply-to:'' header if one is found, and if not then to the address(es) given in the ``from:'' header (as per the RFC-2822 rules for replying to a message).

The addresses to which replies have been sent are recorded, along with the time a reply was sent to them, in a db(3) database in the file .vacation.db in your home directory. No reply will be sent to any address which has been logged in this file unless the last reply was sent more than interval (see -r above) days ago.

Fatal errors, such as calling vacation with incorrect arguments, or with a non-existent logins, and any errors accessing files or errors sending messages are logged in the system log file, using syslog(3), and if -d is given they are also printed to the standard error descriptor.


The vacation utility exits with a value of zero (0) on success, and greater than zero (>0) if an error occurs. The non-zero exit values are defined in <sysexits.h>.


default recipient database file name in the user's home directory
default name of the file containing the message to send


An example ~/.forward file might contain:
\eric, "|/usr/bin/vacation"

which would save messages sent to you in your system mailbox (assuming your login name was eric) and would also reply with copies of your ~/.vacation.msg message (modulo the constraints outlined above).

An example ~/.vacation.msg file might contain a message similar to the following:

From: eric@CS.Berkeley.EDU (Eric Allman)
Subject: I am on vacation
Summary: Re: $SUBJECT
Delivered-By-The-Graces-Of: The Vacation program

I am on vacation until July 22. If you have something urgent, please contact Keith Bostic . -- eric


syslog(3), sendmail(8)


The vacation command first appeared in 4.3BSD.

vacation was rewritten by Greg A. Woods <> to obey RFC-2822.


The value of ``infinity'' for the reply interval is actually stored as LONG_MAX.

There's no facility for folding or filling text or headers in the outgoing message.

The entire recipient address of a sent reply, comments, multiple addresses, and all, is stored in the recent recipients database.