Go to the first, previous, next, last section, table of contents.

Mail commands

There are two commands which cause the creation of a new mail message, which does not count as a significant delivery unless the command is preceded by the word "seen". This is a powerful facility, but it should be used with care, because of the danger of creating infinite sequences of messages. The system administrator can forbid the use of these commands altogether.

To help prevent runaway message sequences, these commands have no effect when the incoming message is a delivery error message, and messages sent by this means are treated as if they were reporting delivery errors. Thus they should never themselves cause a delivery error message to be returned. The basic mail-sending command is

     mail [to <address-list>]
          [cc <address-list>]
          [bcc <address-list>]
          [subject <text>]
          [text <text>]
          [[expand] file <filename>]
          [return message]
          [log <log file name>]
          [once <note file name>]

e.g. mail text "Your message about $h_subject has been received"

As a convenience for use in one common case, there is also a command called `vacation'. It behaves in the same way as `mail', except that the defaults for the "file", "log", and "once" options are

expand file .vacation.msg
       log  .vacation.log
       once .vacation

respectively. This mimics the behaviour of the traditional Unix `vacation' command. If a file name is given to "vacation", it is expanded only if explicitly requested.

The key/value argument pairs can appear in any order. At least one of "text" or "file" must appear (except with "vacation"); if both are present, the text string appears first in the message. If "expand" precedes "file", then each line of the file is subject to string expansion as it is included in the message.

Several lines of text can be supplied to "text" by including the escape sequence `\n' in the string where newlines are required. If the command is output during filter file testing, newlines in the text are shown as `\n'.

If no "to" argument appears, the message is sent to the address in the "Reply_address" variable (see section "String expansion" above). An "In-Reply-To:" header is automatically included in the created message, giving a reference to the message identification of the incoming message.

If `return message' is specified, the incoming message that caused the filter file to be run is added to the end of the message, subject to a limitation as the the maximum size that is returned.

If a log file is specified, a line is added to it for each message sent. If a "once" file is specified, it is used to create a database for remembering who has received a message, and no more than one message is ever sent to any particular address.

The file name specified for "once" is used as the base name for direct-access (DBM) file operations. There are a number of different DBM libraries in existence. Some operating systems provide one as a default, but even in this case a different one may have been used when building Exim. With some DBM libraries, specifying "once" results in two files being created, with the suffixes ".dir" and ".pag" being added to the given name. With some others a single file with the suffix ".db" is used, or the name is used unchanged.

Go to the first, previous, next, last section, table of contents.