~ubuntu-branches/ubuntu/saucy/postfix/saucy

« back to all changes in this revision

Viewing changes to html/header_checks.5.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2011-02-22 11:20:43 UTC
  • mfrom: (1.1.27 upstream)
  • Revision ID: james.westby@ubuntu.com-20110222112043-c34ht219w3ybrilr
Tags: 2.8.0-2
* a little more lintian cleanup
* Fix missing format strings in smtp-sink.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
       <b><a href="postconf.5.html#nested_header_checks">nested_header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/nested_header_checks</b>
16
16
       <b><a href="postconf.5.html#body_checks">body_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/body_checks</b>
17
17
 
 
18
       <b><a href="postconf.5.html#milter_header_checks">milter_header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/<a href="postconf.5.html#milter_header_checks">milter_header_checks</a></b>
 
19
 
 
20
       <b><a href="postconf.5.html#smtp_header_checks">smtp_header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/smtp_header_checks</b>
 
21
       <b><a href="postconf.5.html#smtp_mime_header_checks">smtp_mime_header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/smtp_mime_header_checks</b>
 
22
       <b><a href="postconf.5.html#smtp_nested_header_checks">smtp_nested_header_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/smtp_nested_header_checks</b>
 
23
       <b><a href="postconf.5.html#smtp_body_checks">smtp_body_checks</a> = <a href="pcre_table.5.html">pcre</a>:/etc/postfix/smtp_body_checks</b>
 
24
 
18
25
       <b>postmap -q "</b><i>string</i><b>" <a href="pcre_table.5.html">pcre</a>:/etc/postfix/</b><i>filename</i>
19
26
       <b>postmap -q - <a href="pcre_table.5.html">pcre</a>:/etc/postfix/</b><i>filename</i> &lt;<i>inputfile</i>
20
27
 
31
38
       is repeated for the next message header  or  message  body
32
39
       line.
33
40
 
 
41
       Note: message headers are examined one logical header at a
 
42
       time, even when a message  header  spans  multiple  lines.
 
43
       Body lines are always examined one line at a time.
 
44
 
34
45
       For  examples, see the EXAMPLES section at the end of this
35
46
       manual page.
36
47
 
40
51
       referenced  below  in the README FILES section if you need
41
52
       more sophisticated content analysis.
42
53
 
43
 
       Postfix supports four built-in content inspection classes:
 
54
<b>FILTERS WHILE RECEIVING MAIL</b>
 
55
       Postfix implements the  following  four  built-in  content
 
56
       inspection classes while receiving mail:
44
57
 
45
 
       <b><a href="postconf.5.html#header_checks">header_checks</a></b>
 
58
       <b><a href="postconf.5.html#header_checks">header_checks</a></b> (default: empty)
46
59
              These   are  applied  to  initial  message  headers
47
60
              (except for the headers  that  are  processed  with
48
61
              <b><a href="postconf.5.html#mime_header_checks">mime_header_checks</a></b>).
68
81
              the initial message headers is treated as body con-
69
82
              tent.
70
83
 
71
 
       Note: message headers are examined one logical header at a
72
 
       time, even when a message  header  spans  multiple  lines.
73
 
       Body lines are always examined one line at a time.
 
84
<b>FILTERS AFTER RECEIVING MAIL</b>
 
85
       Postfix  supports a subset of the built-in content inspec-
 
86
       tion classes after the message is received:
 
87
 
 
88
       <b><a href="postconf.5.html#milter_header_checks">milter_header_checks</a></b> (default: empty)
 
89
              These are applied to headers that  are  added  with
 
90
              Milter applications.
 
91
 
 
92
              This feature is available in Postfix 2.7 and later.
 
93
 
 
94
<b>FILTERS WHILE DELIVERING MAIL</b>
 
95
       Postfix supports all four content inspection classes while
 
96
       delivering mail via SMTP.
 
97
 
 
98
       <b><a href="postconf.5.html#smtp_header_checks">smtp_header_checks</a></b> (default: empty)
 
99
 
 
100
       <b><a href="postconf.5.html#smtp_mime_header_checks">smtp_mime_header_checks</a></b> (default: empty)
 
101
 
 
102
       <b><a href="postconf.5.html#smtp_nested_header_checks">smtp_nested_header_checks</a></b> (default: empty)
 
103
 
 
104
       <b><a href="postconf.5.html#smtp_body_checks">smtp_body_checks</a></b> (default: empty)
 
105
              These  features  are  available  in Postfix 2.5 and
 
106
              later.
74
107
 
75
108
<b>COMPATIBILITY</b>
76
109
       With Postfix version 2.2 and earlier specify "<b>postmap -fq</b>"
77
110
       to query a table that contains case sensitive patterns. By
78
 
       default,  <a href="regexp_table.5.html">regexp</a>: and <a href="pcre_table.5.html">pcre</a>: patterns are case insensitive.
 
111
       default, <a href="regexp_table.5.html">regexp</a>: and <a href="pcre_table.5.html">pcre</a>: patterns are case  insensitive.
79
112
 
80
113
<b>TABLE FORMAT</b>
81
 
       This document assumes that header  and  <a href="postconf.5.html#body_checks">body_checks</a>  rules
82
 
       are  specified  in  the form of Postfix regular expression
83
 
       lookup tables. Usually the best  performance  is  obtained
 
114
       This  document  assumes  that header and <a href="postconf.5.html#body_checks">body_checks</a> rules
 
115
       are specified in the form of  Postfix  regular  expression
 
116
       lookup  tables.  Usually  the best performance is obtained
84
117
       with <b>pcre</b> (Perl Compatible Regular Expression) tables, but
85
 
       the slower <b>regexp</b> (POSIX regular expressions)  support  is
86
 
       more  widely  available.  Use the command "<b>postconf -m</b>" to
87
 
       find out what lookup table types your Postfix system  sup-
 
118
       the  slower  <b>regexp</b> (POSIX regular expressions) support is
 
119
       more widely available.  Use the command "<b>postconf  -m</b>"  to
 
120
       find  out what lookup table types your Postfix system sup-
88
121
       ports.
89
122
 
90
123
       The general format of Postfix regular expression tables is
91
 
       given below.  For a  discussion  of  specific  pattern  or
92
 
       flags   syntax,   see  <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>  or  <a href="regexp_table.5.html"><b>regexp_table</b>(5)</a>,
 
124
       given  below.   For  a  discussion  of specific pattern or
 
125
       flags  syntax,  see  <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>   or   <a href="regexp_table.5.html"><b>regexp_table</b>(5)</a>,
93
126
       respectively.
94
127
 
95
128
       <b>/</b><i>pattern</i><b>/</b><i>flags action</i>
96
 
              When /<i>pattern</i>/ matches the  input  string,  execute
97
 
              the  corresponding  <i>action</i>. See below for a list of
 
129
              When  /<i>pattern</i>/  matches  the input string, execute
 
130
              the corresponding <i>action</i>. See below for a  list  of
98
131
              possible actions.
99
132
 
100
133
       <b>!/</b><i>pattern</i><b>/</b><i>flags action</i>
101
 
              When /<i>pattern</i>/ does <b>not</b>  match  the  input  string,
 
134
              When  /<i>pattern</i>/  does  <b>not</b>  match the input string,
102
135
              execute the corresponding <i>action</i>.
103
136
 
104
137
       <b>if /</b><i>pattern</i><b>/</b><i>flags</i>
105
138
 
106
139
       <b>endif</b>  Match the input string against the patterns between
107
 
              <b>if</b> and <b>endif</b>, if and only if the same input  string
 
140
              <b>if</b>  and <b>endif</b>, if and only if the same input string
108
141
              also matches /<i>pattern</i>/. The <b>if</b>..<b>endif</b> can nest.
109
142
 
110
 
              Note:  do not prepend whitespace to patterns inside
 
143
              Note: do not prepend whitespace to patterns  inside
111
144
              <b>if</b>..<b>endif</b>.
112
145
 
113
146
       <b>if !/</b><i>pattern</i><b>/</b><i>flags</i>
114
147
 
115
148
       <b>endif</b>  Match the input string against the patterns between
116
 
              <b>if</b>  and <b>endif</b>, if and only if the same input string
 
149
              <b>if</b> and <b>endif</b>, if and only if the same input  string
117
150
              does <b>not</b> match /<i>pattern</i>/. The <b>if</b>..<b>endif</b> can nest.
118
151
 
119
152
       blank lines and comments
120
 
              Empty lines and whitespace-only lines are  ignored,
121
 
              as  are  lines whose first non-whitespace character
 
153
              Empty  lines and whitespace-only lines are ignored,
 
154
              as are lines whose first  non-whitespace  character
122
155
              is a `#'.
123
156
 
124
157
       multi-line text
125
 
              A pattern/action line  starts  with  non-whitespace
126
 
              text.  A line that starts with whitespace continues
 
158
              A  pattern/action  line  starts with non-whitespace
 
159
              text. A line that starts with whitespace  continues
127
160
              a logical line.
128
161
 
129
162
<b>TABLE SEARCH ORDER</b>
130
 
       For each line of message input, the patterns  are  applied
131
 
       in  the order as specified in the table. When a pattern is
132
 
       found that  matches  the  input  line,  the  corresponding
133
 
       action  is  executed  and  then  the  next  input  line is
 
163
       For  each  line of message input, the patterns are applied
 
164
       in the order as specified in the table. When a pattern  is
 
165
       found  that  matches  the  input  line,  the corresponding
 
166
       action is  executed  and  then  the  next  input  line  is
134
167
       inspected.
135
168
 
136
169
<b>TEXT SUBSTITUTION</b>
137
 
       Substitution of substrings  from  the  matched  expression
138
 
       into  the <i>action</i> string is possible using the conventional
139
 
       Perl syntax (<b>$1</b>, <b>$2</b>, etc.).   The  macros  in  the  result
140
 
       string  may  need  to  be  written as <b>${n}</b> or <b>$(n)</b> if they
 
170
       Substitution  of  substrings  from  the matched expression
 
171
       into the <i>action</i> string is possible using the  conventional
 
172
       Perl  syntax  (<b>$1</b>,  <b>$2</b>,  etc.).   The macros in the result
 
173
       string may need to be written as  <b>${n}</b>  or  <b>$(n)</b>  if  they
141
174
       aren't followed by whitespace.
142
175
 
143
 
       Note: since negated patterns (those preceded by <b>!</b>)  return
 
176
       Note:  since negated patterns (those preceded by <b>!</b>) return
144
177
       a result when the expression does not match, substitutions
145
178
       are not available for negated patterns.
146
179
 
149
182
       case for consistency with other Postfix documentation.
150
183
 
151
184
       <b>DISCARD</b> <i>optional text...</i>
152
 
              Claim  successful delivery and silently discard the
153
 
              message.  Log the optional text if specified,  oth-
 
185
              Claim successful delivery and silently discard  the
 
186
              message.   Log the optional text if specified, oth-
154
187
              erwise log a generic message.
155
188
 
156
 
              Note:   this  action  disables  further  header  or
157
 
              <a href="postconf.5.html#body_checks">body_checks</a> inspection of the current  message  and
 
189
              Note:  this  action  disables  further  header   or
 
190
              <a href="postconf.5.html#body_checks">body_checks</a>  inspection  of the current message and
158
191
              affects all recipients.  To discard only one recip-
159
192
              ient without discarding the entire message, use the
160
193
              <a href="transport.5.html">transport(5)</a> table to direct mail to the <a href="discard.8.html">discard(8)</a>
162
195
 
163
196
              This feature is available in Postfix 2.0 and later.
164
197
 
 
198
              This feature is not supported with smtp header/body
 
199
              checks.
 
200
 
165
201
       <b>DUNNO</b>  Pretend  that the input line did not match any pat-
166
202
              tern, and inspect the next input line. This  action
167
203
              can be used to shorten the table search.
204
240
 
205
241
              This feature is available in Postfix 2.0 and later.
206
242
 
 
243
              This feature is not supported with smtp header/body
 
244
              checks.
 
245
 
207
246
       <b>HOLD</b> <i>optional text...</i>
208
 
              Arrange for the message to be placed  on  the  <b>hold</b>
209
 
              queue,  and  inspect the next input line.  The mes-
210
 
              sage remains on <b>hold</b> until someone  either  deletes
211
 
              it  or  releases it for delivery.  Log the optional
 
247
              Arrange  for  the  message to be placed on the <b>hold</b>
 
248
              queue, and inspect the next input line.   The  mes-
 
249
              sage  remains  on <b>hold</b> until someone either deletes
 
250
              it or releases it for delivery.  Log  the  optional
212
251
              text if specified, otherwise log a generic message.
213
252
 
214
 
              Mail  that  is  placed on hold can be examined with
215
 
              the <a href="postcat.1.html"><b>postcat</b>(1)</a> command, and  can  be  destroyed  or
 
253
              Mail that is placed on hold can  be  examined  with
 
254
              the  <a href="postcat.1.html"><b>postcat</b>(1)</a>  command,  and  can be destroyed or
216
255
              released with the <a href="postsuper.1.html"><b>postsuper</b>(1)</a> command.
217
256
 
218
 
              Note:  use  "<b>postsuper -r</b>" to release mail that was
219
 
              kept on hold for a significant fraction  of  <b>$<a href="postconf.5.html#maximal_queue_lifetime">maxi</a>-</b>
 
257
              Note: use "<b>postsuper -r</b>" to release mail  that  was
 
258
              kept  on  hold for a significant fraction of <b>$<a href="postconf.5.html#maximal_queue_lifetime">maxi</a>-</b>
220
259
              <b><a href="postconf.5.html#maximal_queue_lifetime">mal_queue_lifetime</a></b>  or  <b>$<a href="postconf.5.html#bounce_queue_lifetime">bounce_queue_lifetime</a></b>,  or
221
 
              longer. Use "<b>postsuper -H</b>" only for mail that  will
 
260
              longer.  Use "<b>postsuper -H</b>" only for mail that will
222
261
              not expire within a few delivery attempts.
223
262
 
224
 
              Note:  this  action  affects  all recipients of the
 
263
              Note: this action affects  all  recipients  of  the
225
264
              message.
226
265
 
227
266
              This feature is available in Postfix 2.0 and later.
228
267
 
 
268
              This feature is not supported with smtp header/body
 
269
              checks.
 
270
 
229
271
       <b>IGNORE</b> Delete the current line from the input, and inspect
230
272
              the next input line.
231
273
 
 
274
       <b>INFO</b> <i>optional text...</i>
 
275
              Log an "info:" record with the <i>optional text...</i> (or
 
276
              log  a  generic  text),  and inspect the next input
 
277
              line. This action is useful for routine logging  or
 
278
              for debugging.
 
279
 
 
280
              This feature is available in Postfix 2.8 and later.
 
281
 
232
282
       <b>PREPEND</b> <i>text...</i>
233
283
              Prepend one  line  with  the  specified  text,  and
234
284
              inspect the next input line.
254
304
 
255
305
              This feature is available in Postfix 2.1 and later.
256
306
 
 
307
              This   feature   is   not   supported   with   mil-
 
308
              ter_header_checks.
 
309
 
257
310
       <b>REDIRECT</b> <i>user@domain</i>
258
 
              Write  a  message  redirection request to the queue
259
 
              file, and inspect the next input  line.  After  the
 
311
              Write a message redirection request  to  the  queue
 
312
              file,  and  inspect  the next input line. After the
260
313
              message is queued, it will be sent to the specified
261
314
              address instead of the intended recipient(s).
262
315
 
263
 
              Note: this action overrides the <b>FILTER</b> action,  and
264
 
              affects  all recipients of the message. If multiple
265
 
              <b>REDIRECT</b> actions fire, only the last  one  is  exe-
 
316
              Note:  this action overrides the <b>FILTER</b> action, and
 
317
              affects all recipients of the message. If  multiple
 
318
              <b>REDIRECT</b>  actions  fire,  only the last one is exe-
266
319
              cuted.
267
320
 
268
321
              This feature is available in Postfix 2.1 and later.
269
322
 
 
323
              This feature is not supported with smtp header/body
 
324
              checks.
 
325
 
270
326
       <b>REPLACE</b> <i>text...</i>
271
327
              Replace the current line with the  specified  text,
272
328
              and inspect the next input line.
302
358
              ning of <i>optional text...</i>, Postfix inserts a default
303
359
              enhanced status code of "5.7.1".
304
360
 
 
361
              This feature is not supported with smtp header/body
 
362
              checks.
 
363
 
305
364
       <b>WARN</b> <i>optional text...</i>
306
 
              Log  a  warning with the <i>optional text...</i> (or log a
307
 
              generic message), and inspect the next input  line.
308
 
              This action is useful for debugging and for testing
309
 
              a pattern before applying more drastic actions.
 
365
              Log a "warning:" record with the  <i>optional  text...</i>
 
366
              (or log a generic text), and inspect the next input
 
367
              line. This action is useful for debugging  and  for
 
368
              testing  a  pattern  before  applying  more drastic
 
369
              actions.
310
370
 
311
371
<b>BUGS</b>
312
372
       Empty lines never match, because some map types mis-behave