~ubuntu-branches/ubuntu/hardy/postfix/hardy-security

« back to all changes in this revision

Viewing changes to html/regexp_table.5.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2007-04-15 16:00:44 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415160044-xl1vjlhf9mdmf43a
Tags: 2.4.0-3
Have preinst get user approval before installing (and being broken) on a
pre-2.6 kernel.  Closes: #417530

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
       regexp_table - format of Postfix regular expression tables
11
11
 
12
12
<b>SYNOPSIS</b>
13
 
       <b>postmap -fq "</b><i>string</i><b>" <a href="regexp_table.5.html">regexp</a>:/etc/postfix/</b><i>filename</i>
 
13
       <b>postmap -q "</b><i>string</i><b>" <a href="regexp_table.5.html">regexp</a>:/etc/postfix/</b><i>filename</i>
14
14
 
15
 
       <b>postmap -fq - <a href="regexp_table.5.html">regexp</a>:/etc/postfix/</b><i>filename</i> &lt;<i>inputfile</i>
 
15
       <b>postmap -q - <a href="regexp_table.5.html">regexp</a>:/etc/postfix/</b><i>filename</i> &lt;<i>inputfile</i>
16
16
 
17
17
<b>DESCRIPTION</b>
18
18
       The Postfix mail system uses optional tables  for  address
19
 
       rewriting or mail routing. These tables are usually in <b>dbm</b>
20
 
       or <b>db</b> format.
 
19
       rewriting,  mail  routing, or access control. These tables
 
20
       are usually in <b>dbm</b> or <b>db</b> format.
21
21
 
22
22
       Alternatively, lookup tables can  be  specified  in  POSIX
23
23
       regular  expression form. In this case, each input is com-
24
 
       pared against a list of patterns,  and  when  a  match  is
25
 
       found the corresponding result is returned.
 
24
       pared against a list of patterns. When a match  is  found,
 
25
       the  corresponding  result  is  returned and the search is
 
26
       terminated.
26
27
 
27
 
       To  find out what types of lookup tables your Postfix sys-
 
28
       To find out what types of lookup tables your Postfix  sys-
28
29
       tem supports use the "<b>postconf -m</b>" command.
29
30
 
30
 
       To test lookup tables, use the "<b>postmap  -fq</b>"  command  as
 
31
       To  test  lookup  tables,  use the "<b>postmap -q</b>" command as
31
32
       described in the SYNOPSIS above.
32
33
 
 
34
<b>COMPATIBILITY</b>
 
35
       With Postfix version 2.2 and earlier specify "<b>postmap -fq</b>"
 
36
       to  query  a  table that contains case sensitive patterns.
 
37
       Patterns are case insensitive by default.
 
38
 
33
39
<b>TABLE FORMAT</b>
34
40
       The general form of a Postfix regular expression table is:
35
41
 
38
44
              responding <i>result</i> value.
39
45
 
40
46
       <b>!/</b><i>pattern</i><b>/</b><i>flags result</i>
41
 
              When  <i>pattern</i>  does <b>not</b> match the input string, use
 
47
              When <i>pattern</i> does <b>not</b> match the input  string,  use
42
48
              the corresponding <i>result</i> value.
43
49
 
44
50
       <b>if /</b><i>pattern</i><b>/</b><i>flags</i>
47
53
              <b>if</b> and <b>endif</b>, if and only if that same input string
48
54
              also matches <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
49
55
 
50
 
              Note: do not prepend whitespace to patterns  inside
 
56
              Note:  do not prepend whitespace to patterns inside
51
57
              <b>if</b>..<b>endif</b>.
52
58
 
53
59
              This feature is available in Postfix 2.1 and later.
56
62
 
57
63
       <b>endif</b>  Match the input string against the patterns between
58
64
              <b>if</b> and <b>endif</b>, if and only if that same input string
59
 
              does <b>not</b> match <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.
60
66
              matches <i>pattern</i>. The <b>if</b>..<b>endif</b> can nest.
61
67
 
62
 
              Note:  do not prepend whitespace to patterns inside
 
68
              Note: do not prepend whitespace to patterns  inside
63
69
              <b>if</b>..<b>endif</b>.
64
70
 
65
71
              This feature is available in Postfix 2.1 and later.
66
72
 
67
73
       blank lines and comments
68
 
              Empty  lines and whitespace-only lines are ignored,
69
 
              as are lines whose first  non-whitespace  character
 
74
              Empty lines and whitespace-only lines are  ignored,
 
75
              as  are  lines whose first non-whitespace character
70
76
              is a `#'.
71
77
 
72
78
       multi-line text
73
 
              A  logical  line starts with non-whitespace text. A
74
 
              line that starts with whitespace continues a  logi-
 
79
              A logical line starts with non-whitespace  text.  A
 
80
              line  that starts with whitespace continues a logi-
75
81
              cal line.
76
82
 
77
 
       Each  pattern  is a POSIX regular expression enclosed by a
 
83
       Each pattern is a POSIX regular expression enclosed  by  a
78
84
       pair of delimiters. The regular expression syntax is docu-
79
 
       mented  in  <b>re_format</b>(7)  with  4.4BSD,  in  <b>regex</b>(5) with
 
85
       mented in  <b>re_format</b>(7)  with  4.4BSD,  in  <b>regex</b>(5)  with
80
86
       Solaris, and in <b>regex</b>(7) with Linux. Other systems may use
81
87
       other document names.
82
88
 
83
 
       The  expression  delimiter  can  be  any character, except
 
89
       The expression delimiter  can  be  any  character,  except
84
90
       whitespace or characters that have special meaning (tradi-
85
 
       tionally  the  forward slash is used). The regular expres-
 
91
       tionally the forward slash is used). The  regular  expres-
86
92
       sion can contain whitespace.
87
93
 
88
94
       By default, matching is case-insensitive, and newlines are
89
 
       not  treated  as  special characters. The behavior is con-
90
 
       trolled by flags, which are toggled by  appending  one  or
 
95
       not treated as special characters. The  behavior  is  con-
 
96
       trolled  by  flags,  which are toggled by appending one or
91
97
       more of the following characters after the pattern:
92
98
 
93
99
       <b>i</b> (default: on)
94
 
              Toggles  the  case  sensitivity  flag.  By default,
 
100
              Toggles the  case  sensitivity  flag.  By  default,
95
101
              matching is case insensitive.
96
102
 
97
103
       <b>x</b> (default: on)
98
 
              Toggles the extended  expression  syntax  flag.  By
99
 
              default,  support for extended expression syntax is
 
104
              Toggles  the  extended  expression  syntax flag. By
 
105
              default, support for extended expression syntax  is
100
106
              enabled.
101
107
 
102
108
       <b>m</b> (default: off)
103
 
              Toggle the multi-line mode flag. When this flag  is
104
 
              on,  the  <b>^</b>  and <b>$</b> metacharacters match immediately
105
 
              after and immediately before a  newline  character,
106
 
              respectively,  in addition to matching at the start
 
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
107
113
              and end of the input string.
108
114
 
109
115
<b>TABLE SEARCH ORDER</b>
110
 
       Patterns are applied in the order as specified in the  ta-
111
 
       ble,  until  a  pattern  is  found  that matches the input
 
116
       Patterns  are applied in the order as specified in the ta-
 
117
       ble, until a pattern  is  found  that  matches  the  input
112
118
       string.
113
119
 
114
 
       Each pattern  is  applied  to  the  entire  input  string.
115
 
       Depending  on  the  application,  that string is an entire
 
120
       Each  pattern  is  applied  to  the  entire  input string.
 
121
       Depending on the application, that  string  is  an  entire
116
122
       client hostname, an entire client IP address, or an entire
117
 
       mail  address.   Thus,  no parent domain or parent network
118
 
       search is done, and <i>user@domain</i>  mail  addresses  are  not
119
 
       broken  up  into  their <i>user</i> and <i>domain</i> constituent parts,
 
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,
120
126
       nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
121
127
 
122
128
<b>TEXT SUBSTITUTION</b>
123
 
       Substitution of substrings  from  the  matched  expression
124
 
       into  the  result  string  is possible using $1, $2, etc.;
 
129
       Substitution  of  substrings  from  the matched expression
 
130
       into the result string is possible  using  $1,  $2,  etc.;
125
131
       specify $$ to produce a $ character as output.  The macros
126
 
       in  the  result  string  may need to be written as ${n} or
 
132
       in the result string may need to be  written  as  ${n}  or
127
133
       $(n) if they aren't followed by whitespace.
128
134
 
129
 
       Note: since negated patterns (those preceded by <b>!</b>)  return
 
135
       Note:  since negated patterns (those preceded by <b>!</b>) return
130
136
       a result when the expression does not match, substitutions
131
137
       are not available for negated patterns.
132
138