Exim Filter Specification section 7

Previous Next Contents (Exim Filter Specification)

## 7. Some useful general variables

A complete list of the available variables is given in the Exim documentation. This shortened list contains the ones that are most likely to be useful in personal filter files:

`$body_linecount`: The number of lines in the body of the message.

`$home`: The user's home directory.

`$local_part`: The part of the email address that precedes the @ sign - normally the user's login name. If support for multiple personal mailboxes is enabled (see section 30 below) and a prefix or suffix for the local part was recognized, it is removed from the string in this variable.

`$local_part_prefix`: If support for multiple personal mailboxes is enabled (see section 30 below), and a local part prefix was recognized, this variable contains the prefix. Otherwise it contains an empty string.

`$local_part_suffix`: If support for multiple personal mailboxes is enabled (see section 30 below), and a local part suffix was recognized, this variable contains the suffix. Otherwise it contains an empty string.

`$message_body`: The initial portion of the body of the message. By default, up to 500 characters are read into this variable, but the system administrator can configure this to some other value. Newlines in the body are converted into single spaces.

`$message_body_end`: The final portion of the body of the message, formatted and limited in the same way as `$message_body`.

`$message_body_size`: The size of the body of the message, in bytes.

`$message_headers`: The header lines of the message, concatenated into a single string, with newline characters between them.

`$message_id`: The message's local identification string, which is unique for each message handled by a single host.

`$message_size`: The size of the entire message, in bytes.

`$original_local_part`: When an address that arrived with the message is being processed, this contains the same value as the variable `$local_part`. However, if an address generated by an alias, forward, or filter file is being processed, this variable contains the local part of the original address.

`$reply_address`: The contents of the `Reply-to:` header, if the message has one; otherwise the contents of the `From:` header. It is the address to which normal replies to the message should be sent.

`$return_path`: The return path - that is, the sender field that will be transmitted as part of the message's envelope if the message is sent to another host. This is the address to which delivery errors are sent. In many cases, this variable has the same value as `$sender_address`, but if, for example, an incoming message to a mailing list has been expanded, `$return_path` may have been changed to contain the address of the list maintainer.

`$sender_address`: The sender address that was received in the envelope of the message. This is not necessarily the same as the contents of the `From:` or `Sender:` header lines. For delivery error messages (``bounce messages'') there is no sender address, and this variable is empty.

`$tod_full`: A full version of the time and date, for example: Wed, 18 Oct 1995 09:51:40 +0100. The timezone is always given as a numerical offset from GMT.

`$tod_log`: The time and date in the format used for writing Exim's log files, for example: 1995-10-12 15:32:29.

Previous Next Contents (Exim Filter Specification)