63
63
<b>endif</b> Match the input string against the patterns between
64
64
<b>if</b> and <b>endif</b>, if and only if that same input string
65
does <b>not</b> match <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
66
matches <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
65
does <b>not</b> match <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
68
Note: do not prepend whitespace to patterns inside
67
Note: do not prepend whitespace to patterns inside
69
68
<b>if</b>..<b>endif</b>.
71
70
This feature is available in Postfix 2.1 and later.
73
72
blank lines and comments
74
Empty lines and whitespace-only lines are ignored,
75
as are lines whose first non-whitespace character
73
Empty lines and whitespace-only lines are ignored,
74
as are lines whose first non-whitespace character
79
A logical line starts with non-whitespace text. A
80
line that starts with whitespace continues a logi-
78
A logical line starts with non-whitespace text. A
79
line that starts with whitespace continues a logi-
83
Each pattern is a POSIX regular expression enclosed by a
82
Each pattern is a POSIX regular expression enclosed by a
84
83
pair of delimiters. The regular expression syntax is docu-
85
mented in <b>re_format</b>(7) with 4.4BSD, in <b>regex</b>(5) with
84
mented in <b>re_format</b>(7) with 4.4BSD, in <b>regex</b>(5) with
86
85
Solaris, and in <b>regex</b>(7) with Linux. Other systems may use
87
86
other document names.
89
The expression delimiter can be any character, except
88
The expression delimiter can be any character, except
90
89
whitespace or characters that have special meaning (tradi-
91
tionally the forward slash is used). The regular expres-
90
tionally the forward slash is used). The regular expres-
92
91
sion can contain whitespace.
94
93
By default, matching is case-insensitive, and newlines are
95
not treated as special characters. The behavior is con-
96
trolled by flags, which are toggled by appending one or
94
not treated as special characters. The behavior is con-
95
trolled by flags, which are toggled by appending one or
97
96
more of the following characters after the pattern:
99
98
<b>i</b> (default: on)
100
Toggles the case sensitivity flag. By default,
99
Toggles the case sensitivity flag. By default,
101
100
matching is case insensitive.
103
102
<b>x</b> (default: on)
104
Toggles the extended expression syntax flag. By
105
default, support for extended expression syntax is
103
Toggles the extended expression syntax flag. By
104
default, support for extended expression syntax is
108
107
<b>m</b> (default: off)
109
Toggle the multi-line mode flag. When this flag is
110
on, the <b>^</b> and <b>$</b> metacharacters match immediately
111
after and immediately before a newline character,
112
respectively, in addition to matching at the start
108
Toggle the multi-line mode flag. When this flag is
109
on, the <b>^</b> and <b>$</b> metacharacters match immediately
110
after and immediately before a newline character,
111
respectively, in addition to matching at the start
113
112
and end of the input string.
115
114
<b>TABLE SEARCH ORDER</b>
116
Patterns are applied in the order as specified in the ta-
117
ble, until a pattern is found that matches the input
115
Patterns are applied in the order as specified in the ta-
116
ble, until a pattern is found that matches the input
120
Each pattern is applied to the entire input string.
121
Depending on the application, that string is an entire
119
Each pattern is applied to the entire input string.
120
Depending on the application, that string is an entire
122
121
client hostname, an entire client IP address, or an entire
123
mail address. Thus, no parent domain or parent network
124
search is done, and <i>user@domain</i> mail addresses are not
125
broken up into their <i>user</i> and <i>domain</i> constituent parts,
122
mail address. Thus, no parent domain or parent network
123
search is done, and <i>user@domain</i> mail addresses are not
124
broken up into their <i>user</i> and <i>domain</i> constituent parts,
126
125
nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
128
127
<b>TEXT SUBSTITUTION</b>
129
Substitution of substrings from the matched expression
130
into the result string is possible using $1, $2, etc.;
128
Substitution of substrings from the matched expression
129
into the result string is possible using $1, $2, etc.;
131
130
specify $$ to produce a $ character as output. The macros
132
in the result string may need to be written as ${n} or
131
in the result string may need to be written as ${n} or
133
132
$(n) if they aren't followed by whitespace.
135
Note: since negated patterns (those preceded by <b>!</b>) return
134
Note: since negated patterns (those preceded by <b>!</b>) return
136
135
a result when the expression does not match, substitutions
137
136
are not available for negated patterns.