transport.5.html revision 1.1.1.6 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=utf-8">
5 <title> Postfix manual - transport(5) </title>
6 </head> <body> <pre>
7 TRANSPORT(5) TRANSPORT(5)
8
9 <b>NAME</b>
10 transport - Postfix transport table format
11
12 <b>SYNOPSIS</b>
13 <b>postmap /etc/postfix/transport</b>
14
15 <b>postmap -q "</b><i>string</i><b>" /etc/postfix/transport</b>
16
17 <b>postmap -q - /etc/postfix/transport</b> <<i>inputfile</i>
18
19 <b>DESCRIPTION</b>
20 The optional <a href="transport.5.html"><b>transport</b>(5)</a> table specifies a mapping from email
21 addresses to message delivery transports and next-hop destinations.
22 Message delivery transports such as <b>local</b> or <b>smtp</b> are defined in the
23 <a href="master.5.html"><b>master.cf</b></a> file, and next-hop destinations are typically hosts or domain
24 names. The table is searched by the <a href="trivial-rewrite.8.html"><b>trivial-rewrite</b>(8)</a> daemon.
25
26 This mapping overrides the default <i>transport</i>:<i>nexthop</i> selection that is
27 built into Postfix:
28
29 <b><a href="postconf.5.html#local_transport">local_transport</a> (default: <a href="local.8.html">local</a>:$<a href="postconf.5.html#myhostname">myhostname</a>)</b>
30 This is the default for final delivery to domains listed with
31 <b><a href="postconf.5.html#mydestination">mydestination</a></b>, and for [<i>ipaddress</i>] destinations that match
32 <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>. The default <i>nexthop</i> des-
33 tination is the MTA hostname.
34
35 <b><a href="postconf.5.html#virtual_transport">virtual_transport</a> (default: <a href="virtual.8.html">virtual</a>:)</b>
36 This is the default for final delivery to domains listed with
37 <b><a href="postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains</a></b>. The default <i>nexthop</i> destination is the
38 recipient domain.
39
40 <b><a href="postconf.5.html#relay_transport">relay_transport</a> (default: relay:)</b>
41 This is the default for remote delivery to domains listed with
42 <b><a href="postconf.5.html#relay_domains">relay_domains</a></b>. In order of decreasing precedence, the <i>nexthop</i>
43 destination is taken from <b><a href="postconf.5.html#relay_transport">relay_transport</a></b>, <b><a href="postconf.5.html#sender_dependent_relayhost_maps">sender_depen</a>-</b>
44 <b><a href="postconf.5.html#sender_dependent_relayhost_maps">dent_relayhost_maps</a></b>, <b><a href="postconf.5.html#relayhost">relayhost</a></b>, or from the recipient domain.
45
46 <b><a href="postconf.5.html#default_transport">default_transport</a> (default: <a href="smtp.8.html">smtp</a>:)</b>
47 This is the default for remote delivery to other destinations.
48 In order of decreasing precedence, the <i>nexthop</i> destination is
49 taken from <b><a href="postconf.5.html#sender_dependent_default_transport_maps">sender_dependent_default_transport_maps</a>,</b>
50 <b><a href="postconf.5.html#default_transport">default_transport</a></b>, <b><a href="postconf.5.html#sender_dependent_relayhost_maps">sender_dependent_relayhost_maps</a></b>, <b><a href="postconf.5.html#relayhost">relayhost</a></b>,
51 or from the recipient domain.
52
53 Normally, the <a href="transport.5.html"><b>transport</b>(5)</a> table is specified as a text file that
54 serves as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> command. The result, an indexed file
55 in <b>dbm</b> or <b>db</b> format, is used for fast searching by the mail system.
56 Execute the command "<b>postmap /etc/postfix/transport</b>" to rebuild an
57 indexed file after changing the corresponding transport table.
58
59 When the table is provided via other means such as NIS, LDAP or SQL,
60 the same lookups are done as for ordinary indexed files.
61
62 Alternatively, the table can be provided as a regular-expression map
63 where patterns are given as regular expressions, or lookups can be
64 directed to a TCP-based server. In those case, the lookups are done in
65 a slightly different way as described below under "REGULAR EXPRESSION
66 TABLES" or "TCP-BASED TABLES".
67
68 <b>CASE FOLDING</b>
69 The search string is folded to lowercase before database lookup. As of
70 Postfix 2.3, the search string is not case folded with database types
71 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
72 lower case.
73
74 <b>TABLE FORMAT</b>
75 The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
76
77 <i>pattern result</i>
78 When <i>pattern</i> matches the recipient address or domain, use the
79 corresponding <i>result</i>.
80
81 blank lines and comments
82 Empty lines and whitespace-only lines are ignored, as are lines
83 whose first non-whitespace character is a `#'.
84
85 multi-line text
86 A logical line starts with non-whitespace text. A line that
87 starts with whitespace continues a logical line.
88
89 The <i>pattern</i> specifies an email address, a domain name, or a domain name
90 hierarchy, as described in section "TABLE SEARCH ORDER".
91
92 The <i>result</i> is of the form <i>transport:nexthop</i> and specifies how or where
93 to deliver mail. This is described in section "RESULT FORMAT".
94
95 <b>TABLE SEARCH ORDER</b>
96 With lookups from indexed files such as DB or DBM, or from networked
97 tables such as NIS, LDAP or SQL, patterns are tried in the order as
98 listed below:
99
100 <i>user+extension@domain transport</i>:<i>nexthop</i>
101 Deliver mail for <i>user+extension@domain</i> through <i>transport</i> to <i>nex-</i>
102 <i>thop</i>.
103
104 <i>user@domain transport</i>:<i>nexthop</i>
105 Deliver mail for <i>user@domain</i> through <i>transport</i> to <i>nexthop</i>.
106
107 <i>domain transport</i>:<i>nexthop</i>
108 Deliver mail for <i>domain</i> through <i>transport</i> to <i>nexthop</i>.
109
110 <i>.domain transport</i>:<i>nexthop</i>
111 Deliver mail for any subdomain of <i>domain</i> through <i>transport</i> to
112 <i>nexthop</i>. This applies only when the string <b><a href="postconf.5.html#transport_maps">transport_maps</a></b> is not
113 listed in the <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a></b> configuration
114 setting. Otherwise, a domain name matches itself and its subdo-
115 mains.
116
117 <b>*</b> <i>transport</i>:<i>nexthop</i>
118 The special pattern <b>*</b> represents any address (i.e. it functions
119 as the wild-card pattern, and is unique to Postfix transport
120 tables).
121
122 Note 1: the null recipient address is looked up as
123 <b>$<a href="postconf.5.html#empty_address_recipient">empty_address_recipient</a></b>@<b>$<a href="postconf.5.html#myhostname">myhostname</a></b> (default: mailer-daemon@hostname).
124
125 Note 2: <i>user@domain</i> or <i>user+extension@domain</i> lookup is available in
126 Postfix 2.0 and later.
127
128 <b>RESULT FORMAT</b>
129 The lookup result is of the form <i>transport</i><b>:</b><i>nexthop</i>. The <i>transport</i>
130 field specifies a mail delivery transport such as <b>smtp</b> or <b>local</b>. The
131 <i>nexthop</i> field specifies where and how to deliver mail.
132
133 The transport field specifies the name of a mail delivery transport
134 (the first name of a mail delivery service entry in the Postfix <a href="master.5.html"><b>mas-</b>
135 <b>ter.cf</b></a> file).
136
137 The nexthop field usually specifies one recipient domain or hostname.
138 In the case of the Postfix SMTP/LMTP client, the nexthop field may con-
139 tain a list of nexthop destinations separated by comma or whitespace
140 (Postfix 3.5 and later).
141
142 The syntax of a nexthop destination is transport dependent. With SMTP,
143 specify a service on a non-default port as <i>host</i>:<i>service</i>, and disable MX
144 (mail exchanger) DNS lookups with [<i>host</i>] or [<i>host</i>]:<i>port</i>. The [] form is
145 required when you specify an IP address instead of a hostname.
146
147 A null <i>transport</i> and null <i>nexthop</i> field means "do not change": use the
148 delivery transport and nexthop information that would be used when the
149 entire transport table did not exist.
150
151 A non-null <i>transport</i> field with a null <i>nexthop</i> field resets the nexthop
152 information to the recipient domain.
153
154 A null <i>transport</i> field with non-null <i>nexthop</i> field does not modify the
155 transport information.
156
157 <b>EXAMPLES</b>
158 In order to deliver internal mail directly, while using a mail relay
159 for all other mail, specify a null entry for internal destinations (do
160 not change the delivery transport or the nexthop information) and spec-
161 ify a wildcard for all other destinations.
162
163 <b>my.domain :</b>
164 <b>.my.domain :</b>
165 <b>* <a href="smtp.8.html">smtp</a>:outbound-relay.my.domain</b>
166
167 In order to send mail for <b>example.com</b> and its subdomains via the <b>uucp</b>
168 transport to the UUCP host named <b>example</b>:
169
170 <b>example.com uucp:example</b>
171 <b>.example.com uucp:example</b>
172
173 When no nexthop host name is specified, the destination domain name is
174 used instead. For example, the following directs mail for <i>user</i>@<b>exam-</b>
175 <b>ple.com</b> via the <b>slow</b> transport to a mail exchanger for <b>example.com</b>.
176 The <b>slow</b> transport could be configured to run at most one delivery
177 process at a time:
178
179 <b>example.com slow:</b>
180
181 When no transport is specified, Postfix uses the transport that matches
182 the address domain class (see DESCRIPTION above). The following sends
183 all mail for <b>example.com</b> and its subdomains to host <b>gateway.exam-</b>
184 <b>ple.com</b>:
185
186 <b>example.com :[gateway.example.com]</b>
187 <b>.example.com :[gateway.example.com]</b>
188
189 In the above example, the [] suppress MX lookups. This prevents mail
190 routing loops when your machine is primary MX host for <b>example.com</b>.
191
192 In the case of delivery via SMTP or LMTP, one may specify <i>host</i>:<i>service</i>
193 instead of just a host:
194
195 <b>example.com <a href="smtp.8.html">smtp</a>:bar.example:2025</b>
196
197 This directs mail for <i>user</i>@<b>example.com</b> to host <b>bar.example</b> port <b>2025</b>.
198 Instead of a numerical port a symbolic name may be used. Specify []
199 around the hostname if MX lookups must be disabled.
200
201 Deliveries via SMTP or LMTP support multiple destinations (Postfix >=
202 3.5):
203
204 <b>example.com <a href="smtp.8.html">smtp</a>:bar.example, foo.example</b>
205
206 This tries to deliver to <b>bar.example</b> before trying to deliver to
207 <b>foo.example</b>.
208
209 The error mailer can be used to bounce mail:
210
211 <b>.example.com <a href="error.8.html">error</a>:mail for *.example.com is not deliverable</b>
212
213 This causes all mail for <i>user</i>@<i>anything</i><b>.example.com</b> to be bounced.
214
215 <b>REGULAR EXPRESSION TABLES</b>
216 This section describes how the table lookups change when the table is
217 given in the form of regular expressions. For a description of regular
218 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>.
219
220 Each pattern is a regular expression that is applied to the entire
221 address being looked up. Thus, <i>some.domain.hierarchy</i> is not looked up
222 via its parent domains, nor is <i>user+foo@domain</i> looked up as
223 <i>user@domain</i>.
224
225 Patterns are applied in the order as specified in the table, until a
226 pattern is found that matches the search string.
227
228 The <a href="trivial-rewrite.8.html"><b>trivial-rewrite</b>(8)</a> server disallows regular expression substitution
229 of $1 etc. in regular expression lookup tables, because that could open
230 a security hole (Postfix version 2.3 and later).
231
232 <b>TCP-BASED TABLES</b>
233 This section describes how the table lookups change when lookups are
234 directed to a TCP-based server. For a description of the TCP
235 client/server lookup protocol, see <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>. This feature is not
236 available up to and including Postfix version 2.4.
237
238 Each lookup operation uses the entire recipient address once. Thus,
239 <i>some.domain.hierarchy</i> is not looked up via its parent domains, nor is
240 <i>user+foo@domain</i> looked up as <i>user@domain</i>.
241
242 Results are the same as with indexed file lookups.
243
244 <b>CONFIGURATION PARAMETERS</b>
245 The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant. The text
246 below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more
247 details including examples.
248
249 <b><a href="postconf.5.html#empty_address_recipient">empty_address_recipient</a> (MAILER-DAEMON)</b>
250 The recipient of mail addressed to the null address.
251
252 <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a> (see 'postconf -d' output)</b>
253 A list of Postfix features where the pattern "example.com" also
254 matches subdomains of example.com, instead of requiring an
255 explicit ".example.com" pattern.
256
257 <b><a href="postconf.5.html#transport_maps">transport_maps</a> (empty)</b>
258 Optional lookup tables with mappings from recipient address to
259 (message delivery transport, next-hop destination).
260
261 <b>SEE ALSO</b>
262 <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a>, rewrite and resolve addresses
263 <a href="master.5.html">master(5)</a>, <a href="master.5.html">master.cf</a> file format
264 <a href="postconf.5.html">postconf(5)</a>, configuration parameters
265 <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager
266
267 <b>README FILES</b>
268 <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a>, address rewriting guide
269 <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
270 <a href="FILTER_README.html">FILTER_README</a>, external content filter
271
272 <b>LICENSE</b>
273 The Secure Mailer license must be distributed with this software.
274
275 <b>AUTHOR(S)</b>
276 Wietse Venema
277 IBM T.J. Watson Research
278 P.O. Box 704
279 Yorktown Heights, NY 10598, USA
280
281 Wietse Venema
282 Google, Inc.
283 111 8th Avenue
284 New York, NY 10011, USA
285
286 TRANSPORT(5)
287 </pre> </body> </html>
288