File: filter_6.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 (101 lines) | stat: -rw-r--r-- 3,655 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
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from filter on 25 November 2000 -->

<TITLE>Exim Filter Specification - Format of filter files</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_5.html">previous</A>, <A HREF="filter_7.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="SEC6" HREF="filter_toc.html#TOC6">Format of filter files</A></H2>

<P>
Apart from leading white space, the first text in a filter file must be

<PRE>
# Exim filter
</PRE>

<P>
This is what distinguishes it from a conventional <TT>`.forward'</TT> file.
If the file does not have this initial line it is treated as a conventional
<TT>`.forward'</TT> file, both when delivering mail and when using the -<EM>bf</EM> testing
mechanism.
The white space in the line is optional, and any capitalization may be used.
Further text on the same line is treated as a comment. For example, you could
have

<PRE>
#   Exim filter   &#60;&#60;== do not edit or remove this line!
</PRE>

<P>
The remainder of the file is a sequence of filtering commands, which consist of
keywords and data values, separated by white space or line breaks, except
in the case of conditions for the <TT>`if'</TT> command, where round brackets
(parentheses) also act as separators. For example, in the command

<PRE>
deliver gulliver@lilliput.fict.example
</PRE>

<P>
the keyword is <TT>`deliver'</TT> and the data value is
<TT>`gulliver@lilliput.fict.example'</TT>. The commands are in free format, and there
are no special terminators. If the character # follows a separator, then
everything from # up to the next newline is ignored. This provides a way of
including comments in a filter file.

</P>
<P>
There are two ways in a data value can be input:

</P>

<UL>

<LI>

If the text contains no white space then it can be typed verbatim.
However, if it is part of a condition, it must also be free of round brackets
(parentheses), as these are used for grouping in conditions.

<LI>

Otherwise it must be enclosed in double quotation marks. In this case, the
character \ (backslash) is treated as an `escape character' within the string,
causing the following character or characters to be treated specially:

<PRE>
\n       is replaced by a newline
\r       is replaced by a carriage return
\t       is replaced by a tab
</PRE>

Backslash followed by up to three octal digits is replaced by the character
specified by those digits, and \x followed by up to two hexacimal digits is
treated similarly. Backslash followed by any other character is replaced
by the second character, so that in particular, \" becomes " and \\ becomes
\.
A data item enclosed in double quotes can be continued onto the next line by
ending the first line with a backslash. Any leading white space at the start of
the continuation line is ignored.
</UL>

<P>
In addition to the escape character processing that occurs when strings are
enclosed in quotes, most data values are also subject to <EM>string expansion</EM>
(as described in the next section), in which case the characters <EM>$</EM> and <EM>\</EM>
are also significant.
This means that if a single backslash is actually required in such a string,
and the string is also quoted, \\\\ has to be entered.

</P>

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