xref: /netbsd-src/external/ibm-public/postfix/dist/html/generic.5.html (revision 181254a7b1bdde6873432bffef2d2decc4b5c22f)
1<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
2        "http://www.w3.org/TR/html4/loose.dtd">
3<html> <head>
4<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
5<title> Postfix manual - generic(5) </title>
6</head> <body> <pre>
7GENERIC(5)                                                          GENERIC(5)
8
9<b>NAME</b>
10       generic - Postfix generic table format
11
12<b>SYNOPSIS</b>
13       <b>postmap /etc/postfix/generic</b>
14
15       <b>postmap -q "</b><i>string</i><b>" /etc/postfix/generic</b>
16
17       <b>postmap -q - /etc/postfix/generic</b> &lt;<i>inputfile</i>
18
19<b>DESCRIPTION</b>
20       The optional <a href="generic.5.html"><b>generic</b>(5)</a> table specifies an address mapping that applies
21       when mail is delivered. This is the opposite of  <a href="canonical.5.html"><b>canonical</b>(5)</a>  mapping,
22       which applies when mail is received.
23
24       Typically, one would use the <a href="generic.5.html"><b>generic</b>(5)</a> table on a system that does not
25       have a valid Internet domain name and that uses something like <i>localdo-</i>
26       <i>main.local</i>  instead.   The <a href="generic.5.html"><b>generic</b>(5)</a> table is then used by the <a href="smtp.8.html"><b>smtp</b>(8)</a>
27       client to transform local  mail  addresses  into  valid  Internet  mail
28       addresses  when mail has to be sent across the Internet.  See the EXAM-
29       PLE section at the end of this document.
30
31       The <a href="generic.5.html"><b>generic</b>(5)</a> mapping affects  both  message  header  addresses  (i.e.
32       addresses  that  appear inside messages) and message envelope addresses
33       (for example, the addresses that are used in SMTP protocol commands).
34
35       Normally, the <a href="generic.5.html"><b>generic</b>(5)</a> table is specified as a text file that  serves
36       as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> command.  The result, an indexed file in <b>dbm</b>
37       or <b>db</b> format, is used for fast searching by the  mail  system.  Execute
38       the  command  "<b>postmap /etc/postfix/generic</b>" to rebuild an indexed file
39       after changing the corresponding text file.
40
41       When the table is provided via other means such as NIS,  LDAP  or  SQL,
42       the same lookups are done as for ordinary indexed files.
43
44       Alternatively,  the  table  can be provided as a regular-expression map
45       where patterns are given as regular  expressions,  or  lookups  can  be
46       directed  to TCP-based server. In those case, the lookups are done in a
47       slightly different way as described  below  under  "REGULAR  EXPRESSION
48       TABLES" or "TCP-BASED TABLES".
49
50<b>CASE FOLDING</b>
51       The  search string is folded to lowercase before database lookup. As of
52       Postfix 2.3, the search string is not case folded with  database  types
53       such  as  <a href="regexp_table.5.html">regexp</a>: or <a href="pcre_table.5.html">pcre</a>: whose lookup fields can match both upper and
54       lower case.
55
56<b>TABLE FORMAT</b>
57       The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
58
59       <i>pattern result</i>
60              When <i>pattern</i> matches a mail address, replace it  by  the  corre-
61              sponding <i>result</i>.
62
63       blank lines and comments
64              Empty  lines and whitespace-only lines are ignored, as are lines
65              whose first non-whitespace character is a `#'.
66
67       multi-line text
68              A logical line starts with  non-whitespace  text.  A  line  that
69              starts with whitespace continues a logical line.
70
71<b>TABLE SEARCH ORDER</b>
72       With  lookups  from  indexed files such as DB or DBM, or from networked
73       tables such as NIS, LDAP or SQL,  each  <i>user</i>@<i>domain</i>  query  produces  a
74       sequence of query patterns as described below.
75
76       Each query pattern is sent to each specified lookup table before trying
77       the next query pattern, until a match is found.
78
79       <i>user</i>@<i>domain address</i>
80              Replace <i>user</i>@<i>domain</i> by <i>address</i>. This form has the highest prece-
81              dence.
82
83       <i>user address</i>
84              Replace  <i>user</i>@<i>site</i>  by  <i>address</i> when <i>site</i> is equal to $<b><a href="postconf.5.html#myorigin">myorigin</a></b>,
85              when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydestination</a></b>, or when it is  listed  in
86              $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>.
87
88       @<i>domain address</i>
89              Replace other addresses in <i>domain</i> by <i>address</i>.  This form has the
90              lowest precedence.
91
92<b>RESULT ADDRESS REWRITING</b>
93       The lookup result is subject to address rewriting:
94
95       <b>o</b>      When the result has the form @<i>otherdomain</i>,  the  result  becomes
96              the same <i>user</i> in <i>otherdomain</i>.
97
98       <b>o</b>      When  "<b><a href="postconf.5.html#append_at_myorigin">append_at_myorigin</a>=yes</b>", append "<b>@$<a href="postconf.5.html#myorigin">myorigin</a></b>" to addresses
99              without "@domain".
100
101       <b>o</b>      When "<b><a href="postconf.5.html#append_dot_mydomain">append_dot_mydomain</a>=yes</b>", append "<b>.$<a href="postconf.5.html#mydomain">mydomain</a></b>" to addresses
102              without ".domain".
103
104<b>ADDRESS EXTENSION</b>
105       When a mail address localpart contains the optional recipient delimiter
106       (e.g., <i>user+foo</i>@<i>domain</i>), the  lookup  order  becomes:  <i>user+foo</i>@<i>domain</i>,
107       <i>user</i>@<i>domain</i>, <i>user+foo</i>, <i>user</i>, and @<i>domain</i>.
108
109       The   <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>   parameter  controls  whether  an
110       unmatched address extension (<i>+foo</i>) is propagated to the result of table
111       lookup.
112
113<b>REGULAR EXPRESSION TABLES</b>
114       This  section  describes how the table lookups change when the table is
115       given in the form of regular expressions. For a description of  regular
116       expression lookup table syntax, see <a href="regexp_table.5.html"><b>regexp_table</b>(5)</a> or <a href="pcre_table.5.html"><b>pcre_table</b>(5)</a>.
117
118       Each  pattern  is  a  regular  expression that is applied to the entire
119       address being looked up. Thus, <i>user@domain</i> mail addresses are not  bro-
120       ken  up  into their <i>user</i> and <i>@domain</i> constituent parts, nor is <i>user+foo</i>
121       broken up into <i>user</i> and <i>foo</i>.
122
123       Patterns are applied in the order as specified in the  table,  until  a
124       pattern is found that matches the search string.
125
126       Results  are the same as with indexed file lookups, with the additional
127       feature that parenthesized substrings from the pattern can be  interpo-
128       lated as <b>$1</b>, <b>$2</b> and so on.
129
130<b>TCP-BASED TABLES</b>
131       This  section  describes  how the table lookups change when lookups are
132       directed  to  a  TCP-based  server.  For  a  description  of  the   TCP
133       client/server  lookup  protocol, see <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>.  This feature is not
134       available up to and including Postfix version 2.4.
135
136       Each lookup operation uses the entire address once.  Thus,  <i>user@domain</i>
137       mail  addresses  are  not  broken  up  into their <i>user</i> and <i>@domain</i> con-
138       stituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>.
139
140       Results are the same as with indexed file lookups.
141
142<b>EXAMPLE</b>
143       The following shows a generic mapping with an indexed file.  When  mail
144       is  sent to a remote host via SMTP, this replaces <i>his@localdomain.local</i>
145       by his ISP mail address, replaces <i>her@localdomain.local</i> by her ISP mail
146       address, and replaces other local addresses by his ISP account, with an
147       address extension of <i>+local</i> (this example assumes that the ISP supports
148       "+" style address extensions).
149
150       /etc/postfix/<a href="postconf.5.html">main.cf</a>:
151           <a href="postconf.5.html#smtp_generic_maps">smtp_generic_maps</a> = <a href="DATABASE_README.html#types">hash</a>:/etc/postfix/generic
152
153       /etc/postfix/generic:
154           his@localdomain.local   hisaccount@hisisp.example
155           her@localdomain.local   heraccount@herisp.example
156           @localdomain.local      hisaccount+local@hisisp.example
157
158       Execute  the  command "<b>postmap /etc/postfix/generic</b>" whenever the table
159       is changed.  Instead of <b>hash</b>, some systems use <b>dbm</b> database  files.  To
160       find  out  what  tables  your system supports use the command "<b>postconf</b>
161       <b>-m</b>".
162
163<b>BUGS</b>
164       The table format does not understand quoting conventions.
165
166<b>CONFIGURATION PARAMETERS</b>
167       The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are  especially  relevant.   The  text
168       below  provides  only  a  parameter  summary.  See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more
169       details including examples.
170
171       <b><a href="postconf.5.html#smtp_generic_maps">smtp_generic_maps</a></b>
172              Address mapping lookup table for envelope and header sender  and
173              recipient addresses while delivering mail via SMTP.
174
175       <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b>
176              A list of address rewriting or forwarding mechanisms that propa-
177              gate an address extension  from  the  original  address  to  the
178              result.  Specify zero or more of <b>canonical</b>, <b>virtual</b>, <b>alias</b>, <b>for-</b>
179              <b>ward</b>, <b>include</b>, or <b>generic</b>.
180
181       Other parameters of interest:
182
183       <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b>
184              The network interface addresses that this system  receives  mail
185              on.   You  need  to  stop  and start Postfix when this parameter
186              changes.
187
188       <b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>
189              Other interfaces that this machine receives mail on by way of  a
190              proxy agent or network address translator.
191
192       <b><a href="postconf.5.html#mydestination">mydestination</a></b>
193              List of domains that this mail system considers local.
194
195       <b><a href="postconf.5.html#myorigin">myorigin</a></b>
196              The domain that is appended to locally-posted mail.
197
198       <b><a href="postconf.5.html#owner_request_special">owner_request_special</a></b>
199              Give special treatment to <b>owner-</b><i>xxx</i> and <i>xxx</i><b>-request</b> addresses.
200
201<b>SEE ALSO</b>
202       <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager
203       <a href="postconf.5.html">postconf(5)</a>, configuration parameters
204       <a href="smtp.8.html">smtp(8)</a>, Postfix SMTP client
205
206<b>README FILES</b>
207       <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a>, address rewriting guide
208       <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
209       <a href="STANDARD_CONFIGURATION_README.html">STANDARD_CONFIGURATION_README</a>, configuration examples
210
211<b>LICENSE</b>
212       The Secure Mailer license must be distributed with this software.
213
214<b>HISTORY</b>
215       A genericstable feature appears in the Sendmail MTA.
216
217       This feature is available in Postfix 2.2 and later.
218
219<b>AUTHOR(S)</b>
220       Wietse Venema
221       IBM T.J. Watson Research
222       P.O. Box 704
223       Yorktown Heights, NY 10598, USA
224
225       Wietse Venema
226       Google, Inc.
227       111 8th Avenue
228       New York, NY 10011, USA
229
230                                                                    GENERIC(5)
231</pre> </body> </html>
232