Exim Specification - 16. The autoreply transport

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

# 16. The autoreply transport

The autoreply transport is not a true transport in that it does not cause the message to be transmitted. Instead, it generates another mail message. It is usually run as the result of mail filtering. A `vacation' message is the standard example.

Autoreply is implemented as a local transport so that it runs under the uid and gid of the local user and with appropriate current and home directories (see chapter 13). The parameters of the message to be sent can be specified in the configuration by the options described below, but in the common case when autoreply is activated as a result of filtering, none of them are normally set, because all the information is obtained from the filter file.

In an attempt to reduce the possibility of message cascades, messages created by the autoreply transport always take the form of delivery error messages. That is, the envelope sender field is empty.

There is a subtle difference between directing a message to a pipe transport that generates some text to be returned to the sender, and directing it to an autoreply transport. This difference is noticeable only if more than one address from the same message is so handled. In the case of a pipe, the separate outputs from the different addresses are gathered up and returned to the sender in a single message, while if autoreply is used, a separate message is generated for each address passed to it.

The private options of the autoreply transport that describe the message are used only when the address passed to it does not contain any reply information. Thus the message is specified entirely by the director or by the transport; it is never built from a mixture of options. The remaining private options (file_optional, group, initgroups, mode, return_message, and user) apply in all cases.

Non-printing characters are not permitted in the header lines generated for the message that autoreply creates, with the exception of space and tab. Other non-printing characters are converted into escape sequences. Whether characters with the top bit set count as printing characters or not is controlled by the print_topbitchars global option.

If any of the generic options for manipulating headers (for example, headers_add) are set on an autoreply transport, they apply to the copy of the original message that is included in the generated message when return_message is set. They do not apply to the generated message itself.

If the autoreply transport receives return code 2 from Exim when it submits the message, indicating that there were no recipients, it does not treat this as an error. This means that autoreplies sent to $sender_address when this is empty (because the incoming message is a delivery failure report) do not cause problems.

## 16.1 Private options for autoreply

### bcc (autoreply)

Type: string, expanded
Default: unset

Specifies the addresses that are to receive `blind carbon copies' of the message when the message is specified by the transport. The string is expanded.

### cc (autoreply)

Type: string, expanded
Default: unset

Specifies recipients of the message and the contents of the Cc: header when the message is specified by the transport. The string is expanded.

### file (autoreply)

Type: string, expanded
Default: unset

The contents of the file are sent as the body of the message when the message is specified by the transport. The string is expanded. If both file and text are set, the text string comes first.

### file_expand (autoreply)

Type: boolean
Default: false

If this is set, the contents of the file named by the file option are subjected to string expansion as they are added to the message.

### file_optional (autoreply)

Type: boolean
Default: false

If this option is true, no error is generated if the file named by the file option does not exist or cannot be read.

### from (autoreply)

Type: string, expanded
Default: unset

The contents of the From: header when the message is specified by the transport. The string is expanded.

### group (autoreply)

Type: string
Default: unset

If this option is set, it specifies the group under whose gid the delivery process is to be run. If it is not set, a value associated with a user may be used (see below); otherwise a value must have been associated with the address by the director which handled it. If the string contains no $ characters, it is resolved when Exim starts up. Otherwise, the string is expanded at the time the transport is run, and must yield either a digit string or a name which can be looked up using getgrnam().

### headers (autoreply)

Type: string, expanded
Default: unset

Specified additional RFC 822 headers that are to be added to the message when the message is specified by the transport. The string is expanded. Several can be given by using `\n' to separate them. There is no check on the format.

### initgroups (autoreply)

Type: boolean
Default: false

If this option is true and the uid is provided by the transport, the initgroups() function is called when running the transport to ensure that any additional groups associated with the uid are set up. By default no additional groups are present.

### log (autoreply)

Type: string, expanded
Default: unset

This option names a file in which a record of every message sent is logged when the message is specified by the transport (as opposed to the director). The string is expanded.

### mode (autoreply)

Type: octal integer
Default: 0600

If either the log file or the `once' file has to be created, this mode is used.

### once (autoreply)

Type: string, expanded
Default: unset

This option names a file or DBM database in which a record of each recipient is kept when the message is specified by the transport. The string is expanded. If once_file_size is not set, a DBM database is used, and it is allowed to grow as large as nessary. If a potential recipient is already in the database, no message is sent by default. However, if once_repeat specifies a time greater than zero, the message is sent if that much time has elapsed since a message was last sent to this recipient. If once is unset, the message is always sent.

If once_file_size is set greater than zero, it changes the way Exim implements the once option. Instead of using a DBM file to record every recipient it sends to, it uses a regular file, whose size will never get larger than the given value. In the file, it keeps a linear list of recipient addresses and times at which they were sent messages. If the file is full when a new address needs to be added, the oldest address is dropped. If once_repeat is not set, this means that a given recipient may receive multiple messages, but at unpredicatable intervals that depend on the rate of turnover of addresses in the file. If once_repeat is set, it specifies a maximum time between repeats.

### once_file_size (autoreply)

Type: integer
Default: 0

See once above.

### once_repeat (autoreply)

Type: time
Default: 0s

See once above.

### reply_to (autoreply)

Type: string, expanded
Default: unset

Specifies the contents of the Reply-To: header when the message is specified by the transport. The string is expanded.

### return_message (autoreply)

Type: boolean
Default: false

If this is set, a copy of the original message is returned with the new message, subject to the maximum size set in the return_size_limit general configuration option.

### subject (autoreply)

Type: string, expanded
Default: unset

The contents of the Subject: header when the message is specified by the transport. The string is expanded.

### text (autoreply)

Type: string, expanded
Default: unset

This specifies a single string to be used as the body of the message when the message is specified by the transport. The string is expanded. If both text and file are set, the text comes first.

### to (autoreply)

Type: string, expanded
Default: unset

Specifies recipients of the message and the contents of the To: header when the message is specified by the transport. The string is expanded.

### user (autoreply)

Type: string
Default: unset

If this option is set, it specifies the user under whose uid the delivery process is to be run. If it is not set, a value must have been associated with the address by the director that handled it. If the string contains no $ characters, it is resolved when Exim starts up. Otherwise, the string is expanded at the time the transport is run, and must yield either a digit string or a name which can be looked up using getpwnam(). When getpwnam() is used, either at start-up time or later, the group id value associated with the user is taken as the value to be used if the group option is not set.

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