~ubuntu-branches/ubuntu/vivid/postfix/vivid-proposed

« back to all changes in this revision

Viewing changes to conf/header_checks

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2005-02-27 09:33:07 UTC
  • Revision ID: james.westby@ubuntu.com-20050227093307-cn789t27ibnlh6tf
Tags: upstream-2.1.5
ImportĀ upstreamĀ versionĀ 2.1.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# HEADER_CHECKS(5)                                 HEADER_CHECKS(5)
 
2
 
3
# NAME
 
4
#        header_checks - Postfix built-in header/body inspection
 
5
 
6
# SYNOPSIS
 
7
#        header_checks = pcre:/etc/postfix/header_checks
 
8
#        mime_header_checks = pcre:/etc/postfix/mime_header_checks
 
9
#        nested_header_checks = pcre:/etc/postfix/nested_header_checks
 
10
#        body_checks = pcre:/etc/postfix/body_checks
 
11
 
12
#        postmap -fq "string" pcre:/etc/postfix/filename
 
13
#        postmap -fq - pcre:/etc/postfix/filename <inputfile
 
14
 
15
# DESCRIPTION
 
16
#        Postfix  provides  a  simple  built-in  content inspection
 
17
#        mechanism that examines incoming mail one  message  header
 
18
#        or one message body line at a time. Each input is compared
 
19
#        against a list of patterns, and when a match is found  the
 
20
#        corresponding  action is executed.  This feature is imple-
 
21
#        mented by the Postfix cleanup(8) server.
 
22
 
23
#        For examples, see the EXAMPLES section at the end of  this
 
24
#        manual page.
 
25
 
26
#        Postfix header or body_checks are designed to stop a flood
 
27
#        of mail from worms or viruses; they do not decode  attach-
 
28
#        ments,  and  they do not unzip archives. See the documents
 
29
#        referenced below in the README FILES section if  you  need
 
30
#        more sophisticated content analysis.
 
31
 
32
#        Postfix supports four built-in content inspection classes:
 
33
 
34
#        header_checks
 
35
#               These  are  applied  to  initial  message   headers
 
36
#               (except  for  the  headers  that are processed with
 
37
#               mime_header_checks).
 
38
 
39
#        mime_header_checks (default: $header_checks)
 
40
#               These are applied to MIME related  message  headers
 
41
#               only.
 
42
 
43
#               This feature is available in Postfix 2.0 and later.
 
44
 
45
#        nested_header_checks (default: $header_checks)
 
46
#               These are applied to message  headers  of  attached
 
47
#               email  messages  (except  for  the headers that are
 
48
#               processed with mime_header_checks).
 
49
 
50
#               This feature is available in Postfix 2.0 and later.
 
51
 
52
#        body_checks
 
53
#               These  are  applied to all other content, including
 
54
#               multi-part message boundaries.
 
55
 
56
#               With Postfix versions before 2.0, all content after
 
57
#               the initial message headers is treated as body con-
 
58
#               tent.
 
59
 
60
#        Note: message headers are examined one logical header at a
 
61
#        time,  even  when  a  message header spans multiple lines.
 
62
#        Body lines are always examined one line at a time.
 
63
 
64
# TABLE FORMAT
 
65
#        This document assumes that header  and  body_checks  rules
 
66
#        are  specified  in  the form of Postfix regular expression
 
67
#        lookup tables. Usually the best  performance  is  obtained
 
68
#        with pcre (Perl Compatible Regular Expression) tables, but
 
69
#        the slower regexp (POSIX regular expressions)  support  is
 
70
#        more  widely  available.   Use  the command postconf -m to
 
71
#        find out what lookup table types your Postfix system  sup-
 
72
#        ports.
 
73
 
74
#        The general format of Postfix regular expression tables is
 
75
#        given below.  For a  discussion  of  specific  pattern  or
 
76
#        flags   syntax,   see  pcre_table(5)  or  regexp_table(5),
 
77
#        respectively.
 
78
 
79
#        /pattern/flags action
 
80
#               When pattern matches the input string, execute  the
 
81
#               corresponding  action. See below for a list of pos-
 
82
#               sible actions.
 
83
 
84
#        !/pattern/flags action
 
85
#               When pattern does not match the input string,  exe-
 
86
#               cute the corresponding action.
 
87
 
88
#        if /pattern/flags
 
89
 
90
#        endif  Match the input string against the patterns between
 
91
#               if and endif, if and only if the input string  also
 
92
#               matches pattern. The if..endif can nest.
 
93
 
94
#               Note:  do not prepend whitespace to patterns inside
 
95
#               if..endif.
 
96
 
97
#        if !/pattern/flags
 
98
 
99
#        endif  Match the input string against the patterns between
 
100
#               if  and endif, if and only if the input string does
 
101
#               not match pattern. The if..endif can nest.
 
102
 
103
#        blank lines and comments
 
104
#               Empty lines and whitespace-only lines are  ignored,
 
105
#               as  are  lines whose first non-whitespace character
 
106
#               is a `#'.
 
107
 
108
#        multi-line text
 
109
#               A pattern/action line  starts  with  non-whitespace
 
110
#               text.  A line that starts with whitespace continues
 
111
#               a logical line.
 
112
 
113
# TABLE SEARCH ORDER
 
114
#        For each line of message input, the patterns  are  applied
 
115
#        in  the order as specified in the table. When a pattern is
 
116
#        found that  matches  the  input  line,  the  corresponding
 
117
#        action  is  executed  and  then  the  next  input  line is
 
118
#        inspected.
 
119
 
120
# TEXT SUBSTITUTION
 
121
#        Substitution of substrings  from  the  matched  expression
 
122
#        into  the action string is possible using the conventional
 
123
#        Perl syntax ($1, $2, etc.).   The  macros  in  the  result
 
124
#        string  may  need  to  be  written as ${n} or $(n) if they
 
125
#        aren't followed by whitespace.
 
126
 
127
#        Note: since negated patterns (those preceded by !)  return
 
128
#        a result when the expression does not match, substitutions
 
129
#        are not available for negated patterns.
 
130
 
131
# ACTIONS
 
132
#        Action names are case insensitive. They are shown in upper
 
133
#        case for consistency with other Postfix documentation.
 
134
 
135
#        DISCARD optional text...
 
136
#               Claim  successful delivery and silently discard the
 
137
#               message.  Log the optional text if specified,  oth-
 
138
#               erwise log a generic message.
 
139
 
140
#               Note:   this  action  disables  further  header  or
 
141
#               body_checks inspection of the current  message  and
 
142
#               affects all recipients.
 
143
 
144
#               This feature is available in Postfix 2.0 and later.
 
145
 
146
#        DUNNO  Pretend that the input line did not match any  pat-
 
147
#               tern,  and inspect the next input line. This action
 
148
#               can be used to shorten the table search.
 
149
 
150
#               For backwards compatibility reasons,  Postfix  also
 
151
#               accepts  OK but it is (and always has been) treated
 
152
#               as DUNNO.
 
153
 
154
#               This feature is available in Postfix 2.1 and later.
 
155
 
156
#        FILTER transport:destination
 
157
#               Write  a  content  filter request to the queue file
 
158
#               and inspect the next input line.   After  the  com-
 
159
#               plete  message  is received it will be sent through
 
160
#               the specified external content filter.  More infor-
 
161
#               mation  about  external  content  filters is in the
 
162
#               Postfix FILTER_README file.
 
163
 
164
#               Note:  this  action  overrides  the  main.cf   con-
 
165
#               tent_filter  setting, and affects all recipients of
 
166
#               the message.  In  the  case  that  multiple  FILTER
 
167
#               actions fire, only the last one is executed.
 
168
 
169
#               This feature is available in Postfix 2.0 and later.
 
170
 
171
#        HOLD optional text...
 
172
#               Arrange for the message to be placed  on  the  hold
 
173
#               queue,  and  inspect the next input line.  The mes-
 
174
#               sage remains on hold until someone  either  deletes
 
175
#               it  or  releases it for delivery.  Log the optional
 
176
#               text if specified, otherwise log a generic message.
 
177
 
178
#               Mail  that  is  placed on hold can be examined with
 
179
#               the postcat(1) command, and  can  be  destroyed  or
 
180
#               released with the postsuper(1) command.
 
181
 
182
#               Note:  this  action  affects  all recipients of the
 
183
#               message.
 
184
 
185
#               This feature is available in Postfix 2.0 and later.
 
186
 
187
#        IGNORE Delete  the current line from the input and inspect
 
188
#               the next input line.
 
189
 
190
#        PREPEND text...
 
191
#               Prepend  one  line  with  the  specified  text  and
 
192
#               inspect the next input line.
 
193
 
194
#               Note:  the  prepended  text  is  output immediately
 
195
#               before the input that triggered the PREPEND action.
 
196
#               A body action cannot prepend a message header.
 
197
 
198
#               Note:  this action cannot be used to prepend multi-
 
199
#               line text.
 
200
 
201
#               This feature is available in Postfix 2.1 and later.
 
202
 
203
#        REDIRECT user@domain
 
204
#               Write  a  message  redirection request to the queue
 
205
#               file and inspect the next  input  line.  After  the
 
206
#               message is queued, it will be sent to the specified
 
207
#               address instead of the intended recipient(s).
 
208
 
209
#               Note: this action overrides the FILTER action,  and
 
210
#               affects  all recipients of the message. If multiple
 
211
#               REDIRECT actions fire, only the last  one  is  exe-
 
212
#               cuted.
 
213
 
214
#               This feature is available in Postfix 2.1 and later.
 
215
 
216
#        REJECT optional text...
 
217
#               Reject the  entire  message.  Reply  with  optional
 
218
#               text... when the optional text is specified, other-
 
219
#               wise reply with a generic error message.
 
220
 
221
#               Note:  this  action  disables  further  header   or
 
222
#               body_checks  inspection  of the current message and
 
223
#               affects all recipients.
 
224
 
225
#        WARN optional text...
 
226
#               Log a warning with the optional text... (or  log  a
 
227
#               generic  message)  and inspect the next input line.
 
228
#               This action is useful for debugging and for testing
 
229
#               a pattern before applying more drastic actions.
 
230
 
231
# BUGS
 
232
#        Many  people  overlook  the main limitations of header and
 
233
#        body_checks rules.  These rules  operate  on  one  logical
 
234
#        message  header or one body line at a time, and a decision
 
235
#        made for one line is not carried over to  the  next  line.
 
236
#        If text in the message body is encoded (RFC 2045) then the
 
237
#        rules have to specified for the encoded  form.   Likewise,
 
238
#        when message headers are encoded (RFC 2047) then the rules
 
239
#        need to be specified for the encoded form.
 
240
 
241
#        Message headers added by the cleanup(8) daemon itself  are
 
242
#        excluded from inspection. Examples of such message headers
 
243
#        are From:, To:, Message-ID:, Date:.
 
244
 
245
#        Message headers deleted by the cleanup(8) daemon  will  be
 
246
#        examined before they are deleted. Examples are: Bcc:, Con-
 
247
#        tent-Length:, Return-Path:.
 
248
 
249
# CONFIGURATION PARAMETERS
 
250
#        body_checks
 
251
#               Lookup tables with content filter rules for message
 
252
#               body lines.  These filters see one physical line at
 
253
#               a time, in chunks  of  at  most  $line_length_limit
 
254
#               bytes.
 
255
 
256
#        body_checks_size_limit
 
257
#               The  amount  of  content  per  message body segment
 
258
#               (attachment) that is subjected to $body_checks fil-
 
259
#               tering.
 
260
 
261
#        header_checks
 
262
 
263
#        mime_header_checks (default: $header_checks)
 
264
 
265
#        nested_header_checks (default: $header_checks)
 
266
#               Lookup tables with content filter rules for message
 
267
#               header lines: respectively, these  are  applied  to
 
268
#               the  initial  message  headers  (not including MIME
 
269
#               headers), to the MIME headers anywhere in the  mes-
 
270
#               sage,  and  to the initial headers of attached mes-
 
271
#               sages.
 
272
 
273
#               Note: these filters see one logical message  header
 
274
#               at  a time, even when a message header spans multi-
 
275
#               ple lines. Message headers  that  are  longer  than
 
276
#               $header_size_limit characters are truncated.
 
277
 
278
#        disable_mime_input_processing
 
279
#               While  receiving mail, give no special treatment to
 
280
#               MIME related message headers; all  text  after  the
 
281
#               initial message headers is considered to be part of
 
282
#               the message body. This means that header_checks  is
 
283
#               applied  to  all  the  initial message headers, and
 
284
#               that body_checks is applied to the remainder of the
 
285
#               message.
 
286
 
287
#               Note:  when  used  in this manner, body_checks will
 
288
#               process a multi-line message header one line  at  a
 
289
#               time.
 
290
 
291
# EXAMPLES
 
292
#        Header  pattern  to  block  attachments with bad file name
 
293
#        extensions.
 
294
 
295
#        /etc/postfix/main.cf:
 
296
#            header_checks = regexp:/etc/postfix/header_checks
 
297
 
298
#        /etc/postfix/header_checks:
 
299
#            /^content-(type|disposition):.*name[[:space:]]*=.*\.(exe|vbs)/
 
300
#                REJECT Bad attachment file name extension: $2
 
301
 
302
#        Body pattern to stop a specific HTML browser vulnerability
 
303
#        exploit.
 
304
 
305
#        /etc/postfix/main.cf:
 
306
#            body_checks = regexp:/etc/postfix/body_checks
 
307
 
308
#        /etc/postfix/body_checks:
 
309
#            /^<iframe src=(3D)?cid:.* height=(3D)?0 width=(3D)?0>$/
 
310
#                REJECT IFRAME vulnerability exploit
 
311
 
312
# SEE ALSO
 
313
#        cleanup(8), canonicalize and enqueue Postfix message
 
314
#        pcre_table(5), format of PCRE lookup tables
 
315
#        regexp_table(5), format of POSIX regular expression tables
 
316
#        postconf(1), Postfix configuration utility
 
317
#        postmap(1), Postfix lookup table management
 
318
#        postsuper(1), Postfix janitor
 
319
#        postcat(1), show Postfix queue file contents
 
320
#        RFC 2045, base64 and quoted-printable encoding rules
 
321
#        RFC 2047, message header encoding for non-ASCII text
 
322
 
323
# README FILES
 
324
#        Use  "postconf  readme_directory" or "postconf html_direc-
 
325
#        tory" to locate this information.
 
326
#        DATABASE_README, Postfix lookup table overview
 
327
#        CONTENT_INSPECTION_README, Postfix content inspection overview
 
328
#        BUILTIN_FILTER_README, Postfix built-in content inspection
 
329
#        BACKSCATTER_README, blocking returned forged mail
 
330
 
331
# LICENSE
 
332
#        The Secure Mailer license must be  distributed  with  this
 
333
#        software.
 
334
 
335
# AUTHOR(S)
 
336
#        Wietse Venema
 
337
#        IBM T.J. Watson Research
 
338
#        P.O. Box 704
 
339
#        Yorktown Heights, NY 10598, USA
 
340
 
341
#                                                  HEADER_CHECKS(5)