File: filter_34.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 (381 lines) | stat: -rw-r--r-- 13,314 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from filter on 25 November 2000 -->

<TITLE>Exim Filter Specification - Expansion variables</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_33.html">previous</A>, next, last section, <A HREF="filter_toc.html">table of contents</A>.
<P><HR><P>


<H2><A NAME="SEC34" HREF="filter_toc.html#TOC34">Expansion variables</A></H2>

<P>
<A NAME="IDX37"></A>

</P>
<P>
This list of expansion variable substitutions contains those that are likely to
be of use in filter files. Others that are not relevant at filtering time, or
are of interest only to the system administrator, are omitted.

</P>
<P>
$<EM>0</EM>, $<EM>1</EM>, etc: When a <EM>matches</EM> expansion condition succeeds, these
variables contain the captured substrings identified by the regular expression
during subsequent processing of the success string of the containing <EM>if</EM>
expansion item. They may also be set externally by some other matching process
which precedes the expansion of the string. For example, the commands available
in Exim filter files include an <EM>if</EM> command with its own regular expression
matching condition.

</P>

<P>
<font color=green>
<A NAME="IDX38"></A>
<A NAME="IDX39"></A>
$<EM>body_linecount</EM>:
When a message is being received or delivered, this variable contains the
number of lines in the message's body.
</font>

</P>

<P>
<A NAME="IDX40"></A>
$<EM>caller_gid</EM>: The group id under which the process that called Exim was
running. This is not the same as the group id of the originator of a message
(see $<EM>originator_gid</EM>). If Exim re-execs itself, this variable in the new
incarnation normally contains the Exim gid.

</P>
<P>
<A NAME="IDX41"></A>
$<EM>caller_uid</EM>: The user id under which the process that called Exim was
running. This is not the same as the user id of the originator of a message
(see $<EM>originator_uid</EM>). If Exim re-execs itself, this variable in the new
incarnation normally contains the Exim uid.

</P>
<P>
$<EM>compile_date</EM>: The date on which the Exim binary was compiled.

</P>
<P>
$<EM>compile_number</EM>: The building process for Exim keeps a count of the number
of times it has been compiled. This serves to distinguish different
compilations of the same version of the program.

</P>
<P>
$<EM>domain</EM>: When an address is being directed, routed, or delivered on its own,
this variable contains the domain. In particular, it is set during
user filtering, but not during system filtering, since a message may have many
recipients and the system filter is called just once.

</P>

<P>
$<EM>home</EM>:
This is set to the user's home directory when user filtering is configured in
the normal way.
When running a filter test via the -<EM>bf</EM> option, $<EM>home</EM> is set to the value
of the environment variable HOME.

</P>

<P>
$<EM>local_part</EM>: When an address is being directed, routed, or delivered on its
own, this variable contains the local part. If a local part prefix or suffix
has been recognized, it is not included in the value.

</P>

<P>
$<EM>local_part_prefix</EM>: When an address is being directed or delivered locally,
and a specific prefix for the local part was recognized, it is available in
this variable. Otherwise it is empty.

</P>
<P>
$<EM>local_part_suffix</EM>: When an address is being directed or delivered locally,
and a specific suffix for the local part was recognized, it is available in
this variable. Otherwise it is empty.

</P>

<P>
<A NAME="IDX42"></A>
<A NAME="IDX43"></A>
$<EM>message_body</EM>: This variable contains the initial portion of a message's
body while it is being delivered, and is intended mainly for use in filter
files. The maximum number of characters of the body that are used is set by the
<EM>message_body_visible</EM> configuration option; the default is 500. Newlines are
converted into spaces to make it easier to search for phrases that might be
split over a line break.

</P>
<P>
<A NAME="IDX44"></A>
<A NAME="IDX45"></A>
$<EM>message_body_end</EM>: This variable contains the final portion of a message's
body while it is being delivered. The format and maximum size are as for
$<EM>message_body</EM>.

</P>
<P>
<A NAME="IDX46"></A>
<A NAME="IDX47"></A>
$<EM>message_body_size</EM>: When a message is being received or delivered, this
variable contains the size of the body in bytes. The count starts from the
character after the blank line that separates the body from the header.
Newlines are included in the count. See also $<EM>message_size</EM> and
$<EM>body_linecount</EM>.

</P>
<P>
$<EM>message_headers</EM>:
This variable contains a concatenation of all the header lines when a message
is being processed. They are separated by newline characters.

</P>
<P>
$<EM>message_id</EM>: When a message is being received or delivered, this variable
contains the unique message id which is used by Exim to identify the message.

</P>
<P>
$<EM>message_precedence</EM>: When a message is being delivered, the value of any
<EM>Precedence:</EM> header is made available in this variable. If there is no such
header, the value is the null string.

</P>
<P>
<A NAME="IDX48"></A>
<A NAME="IDX49"></A>
<font color=green>
$<EM>message_size</EM>: When a message is being received or delivered, this variable
contains its size in bytes. In most cases, the size includes those headers that
were received with the message, but not those (such as <EM>Envelope-to:</EM>) that are
added to individual deliveries as they are written.
</font>
See also $<EM>message_body_size</EM> and $<EM>body_linecount</EM>.

</P>
<P>
$<EM>n0</EM> -- $<EM>n9</EM>: These variables are counters that can be incremented by means
of the <EM>add</EM> command in filter files.

</P>
<P>
$<EM>original_domain</EM>: When a top-level address is being processed for delivery,
this contains the same value as $<EM>domain</EM>. However, if a `child' address (for
example, generated by an alias, forward, or filter file) is being processed,
this variable contains the domain of the original address.
This differs from $<EM>parent_domain</EM> when there is more than one level of
aliasing or forwarding.

</P>
<P>
$<EM>original_local_part</EM>: When a top-level address is being processed for
delivery, this contains the same value as $<EM>local_part</EM>. However, if a
`child' address (for example, generated by an alias, forward, or filter file)
is being processed, this variable contains the local part of the original
address.
This differs from $<EM>parent_local_part</EM> when there is more than one level of
aliasing or forwarding.

</P>
<P>
<A NAME="IDX50"></A>
<A NAME="IDX51"></A>
$<EM>originator_gid</EM>: The value of $<EM>caller_gid</EM> that was set when the message
was received. For messages received via the command line, this is the gid of
the sending user. For messages received by SMTP over TCP/IP, this is normally
the gid of the Exim user.

</P>
<P>
<A NAME="IDX52"></A>
<A NAME="IDX53"></A>
$<EM>originator_uid</EM>: The value of $<EM>caller_uid</EM> that was set when the message
was received. For messages received via the command line, this is the uid of
the sending user. For messages received by SMTP over TCP/IP, this is normally
the uid of the Exim user.

</P>
<P>
$<EM>parent_domain</EM>: This variable is empty, except when a `child' address
(generated by aliasing or forwarding, for example) is being processed, in which
case it contains the domain of the immediately preceding parent address.

</P>
<P>
$<EM>parent_local_part</EM>: This variable is empty, except when a `child' address
(generated by aliasing or forwarding, for example) is being processed, in which
case it contains the local part of the immediately preceding parent address.

</P>

<P>
$<EM>primary_hostname</EM>: The value set in the configuration file, or read by the
<EM>uname()</EM> function.

</P>

<P>
$<EM>qualify_domain</EM>: The value set for this option in the configuration file.

</P>
<P>
$<EM>qualify_recipient</EM>: The value set for this option in the configuration file,
or if not set, the value of $<EM>qualify_domain</EM>.

</P>

<P>
$<EM>received_protocol</EM>: When a message is being processed, this variable
contains the name of the protocol by which it was received.

</P>

<P>
$<EM>reply_address</EM>: When a message is being processed, this variable contains
the contents of the <EM>Reply-To:</EM> header line if one exists, or otherwise the
contents of the <EM>From:</EM> header line.
<font color=green>
However, if the message contains a set of <TT>`Resent-'</TT> header lines, their
contents are used in preference.
</font>

</P>
<P>
$<EM>return_path</EM>: When a message is being delivered, this variable contains the
return path -- the sender field that will be sent as part of the envelope. It
is not enclosed in &#60;&#62; characters. In many cases, $<EM>return_path</EM> has the
same value as $<EM>sender_address</EM>, but if, for example, an incoming message to
a mailing list has been expanded by a director which specifies a specific
address for delivery error messages, $<EM>return_path</EM> contains the new error
address, while $<EM>sender_address</EM> contains the original sender address that
was received with the message.

</P>

<P>
$<EM>sender_address</EM>: When a message is being processed, this variable contains
the sender's address that was received in the message's envelope.
For delivery failure reports, the value of this variable is the empty string.

</P>
<P>
$<EM>sender_address_domain</EM>: The domain portion of $<EM>sender_address</EM>.

</P>
<P>
$<EM>sender_address_local_part</EM>: The local part portion of $<EM>sender_address</EM>.

</P>
<P>
$<EM>sender_fullhost</EM>: When a message is received from a remote host, this
variable contains the host name and IP address in a single string, which always
ends with the IP address in square brackets.
<font color=green>
If <EM>log_incoming_port</EM> is set, the port number on the remote host is added to
the IP address, separated by a full stop.
</font>
The format of the rest of the string depends on whether the host issued a
HELO or EHLO SMTP command, and whether the host name was verified by
looking up its IP address.
A plain host name at the start of the string is a verified host name; if this
is not present, verification either failed or was not requested. A host name in
parentheses is the argument of a HELO or EHLO command. This is omitted
if it is identical to the verified host name or to the host's IP address in
square brackets.

</P>
<P>
$<EM>sender_helo_name</EM>: When a message is received from a remote host that has
issued a HELO or EHLO command, the first item in the argument of that
command is placed in this variable. It is also set if HELO or EHLO is
used when a message is received using SMTP locally via the -<EM>bs</EM> or -<EM>bS</EM>
options.

</P>
<P>
$<EM>sender_host_address</EM>: When a message is received from a remote host, this
variable contains that host's IP address.

</P>

<P>
$<EM>sender_host_name</EM>: When a message is received from a remote host, this
variable contains the host's name as verified by looking up its IP address. If
verification failed, or was not requested, this variable contains the empty
string.

</P>
<P>
<font color=green>
$<EM>sender_host_port</EM>: When a message is received from a remote host, this
variable contains the port number that was used on the remote host.
</font>

</P>
<P>
$<EM>sender_ident</EM>: When a message is received from a remote host, this variable
contains the identification received in response to an RFC 1413 request. When a
message has been received locally, this variable contains the login name of the
user that called Exim.

</P>

<P>
$<EM>sn0</EM> -- $<EM>sn9</EM>: These variables are copies of the values of the $<EM>n0</EM>
-- $<EM>n9</EM> accumulators that were current at the end of the system filter file.
This allows a system filter file to set values that can be tested in users'
filter files. For example, a system filter could set a value indicating how
likely it is that a message is junk mail.

</P>

<P>
$<EM>thisaddress</EM>: This variable is set only during the processing of the
<EM>foranyaddress</EM> command in a filter file. Its use is explained in the
description of that command.

</P>

<P>
$<EM>tod_bsdinbox</EM>: The time of day and date, in the format required for
BSD-style mailbox files, for example: Thu Oct 17 17:14:09 1995.

</P>
<P>
$<EM>tod_full</EM>: A full version of the time and date, for example: Wed, 16 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>
<A NAME="IDX54"></A>
$<EM>value</EM>: This variable contains the result of an expansion lookup operation,
as described above.
If $<EM>value</EM> is used in other circumstances, its contents are null.

</P>
<P>
$<EM>version_number</EM>: The version number of Exim.

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