File: filter_7.html

package info (click to toggle)
exim-html 3.20-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge, woody
  • size: 2,868 kB
  • ctags: 4,188
  • sloc: makefile: 40; sh: 19
file content (149 lines) | stat: -rw-r--r-- 5,116 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from filter on 25 November 2000 -->

<TITLE>Exim Filter Specification - String expansion</TITLE>
</HEAD>
<body bgcolor="#FFFFFF" text="#00005A" link="#FF6600" alink="#FF9933" vlink="#990000">
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_6.html">previous</A>, <A HREF="filter_8.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
<P><HR><P>


<H2><A NAME="SEC7" HREF="filter_toc.html#TOC7">String expansion</A></H2>

<P>
Most data values are expanded before use. Expansion consists of replacing
substrings beginning with <EM>$</EM> with other text. The full expansion facilities
are described from section 29 below onwards, but the most common
case is the substitution of a simple variable. For example, the substring

<PRE>
$reply_address
</PRE>

<P>
is replaced by the address to which replies to the message should be sent. If
such a variable name is followed by a letter or digit or underscore, it must be
enclosed in curly brackets (braces), for example,

<PRE>
${reply_address}
</PRE>

<P>
If a <TT>`$'</TT> character is actually required in an expanded string, it must be
escaped with a backslash, and because backslash is also an escape character in
quoted input strings, it must be doubled in that case. The following two
examples illustrate the two cases:

<PRE>
if $local_part contains \$ then ...
if $local_part contains "\\$" then ...
</PRE>

<P>
The variable substitutions most likely to be useful in filter files are:

</P>
<P>
$<EM>home</EM>: The user's home directory.

</P>
<P>
$<EM>local_part</EM>: 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 26 below) and a prefix or suffix for the local
part was recognized, it is removed from the string in this variable.

</P>
<P>
$<EM>local_part_prefix</EM>: If support for multiple personal mailboxes is enabled
(see section 26 below), and a local part prefix was recognized, then
this variable contains the prefix. Otherwise it contains an empty string.

</P>
<P>
$<EM>local_part_suffix</EM>: If support for multiple personal mailboxes is enabled
(see section 26 below), and a local part suffix was recognized, then
this variable contains the suffix. Otherwise it contains an empty string.

</P>
<P>
$<EM>message_body</EM>: 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.

</P>
<P>
$<EM>message_body_end</EM>: The final portion of the body of the message, formatted
and limited in the same way as $<EM>message_body</EM>.

</P>
<P>
$<EM>message_body_size</EM>: The size of the body of the message, in bytes.

</P>
<P>
$<EM>message_headers</EM>: The header lines of the message, concatenated into a
single string, with newline characters between them.

</P>
<P>
$<EM>message_id</EM>: The message's local identification string, which is unique for
each message handled by a single host.

</P>
<P>
$<EM>message_size</EM>: The size of the entire message, in bytes.

</P>
<P>
$<EM>original_local_part</EM>: When a top-level address is being processed, this
contains the same value as the variable $<EM>local_part</EM>. 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.

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

</P>
<P>
$<EM>return_path</EM>: The return path -- that is, the sender field that will be
sent as part of the message's envelope, and which is the address to which
delivery errors are sent. In many cases, this has the same value as
$<EM>sender_address</EM>, but if, for example, an incoming message to a mailing list
has been expanded, then $<EM>return_path</EM> may contain the address of the list
maintainer instead.

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

</P>
<P>
$<EM>tod_full</EM>: 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.

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

</P>

<P><HR><P>
Go to the <A HREF="filter_1.html">first</A>, <A HREF="filter_6.html">previous</A>, <A HREF="filter_8.html">next</A>, <A HREF="filter_34.html">last</A> section, <A HREF="filter_toc.html">table of contents</A>.
</BODY>
</HTML>