1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
5 <title> Postfix manual - transport(
5)
</title>
7 TRANSPORT(
5) TRANSPORT(
5)
10 transport - Postfix transport table format
13 <b>postmap /etc/postfix/transport
</b>
15 <b>postmap -q
"</b><i>string</i><b>" /etc/postfix/transport
</b>
17 <b>postmap -q - /etc/postfix/transport
</b> <<i>inputfile
</i>
20 The optional
<a href=
"transport.5.html"><b>transport
</b>(
5)
</a> table specifies a mapping from
21 email addresses to message delivery transports and next-
22 hop destinations. Message delivery transports such as
23 <b>local
</b> or
<b>smtp
</b> are defined in the
<a href=
"master.5.html"><b>master.cf
</b></a> file, and next-
24 hop destinations are typically hosts or domain names. The
25 table is searched by the
<a href=
"trivial-rewrite.8.html"><b>trivial-rewrite
</b>(
8)
</a> daemon.
27 This mapping overrides the default
<i>transport
</i>:
<i>nexthop
</i>
28 selection that is built into Postfix:
30 <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>
31 This is the default for final delivery to domains
32 listed with
<b><a href=
"postconf.5.html#mydestination">mydestination
</a></b>, and for [
<i>ipaddress
</i>] des-
33 tinations that match
<b>$
<a href=
"postconf.5.html#inet_interfaces">inet_interfaces
</a></b> or
34 <b>$
<a href=
"postconf.5.html#proxy_interfaces">proxy_interfaces
</a></b>. The default
<i>nexthop
</i> destination
37 <b><a href=
"postconf.5.html#virtual_transport">virtual_transport
</a> (default:
<a href=
"virtual.8.html">virtual
</a>:)
</b>
38 This is the default for final delivery to domains
39 listed with
<b><a href=
"postconf.5.html#virtual_mailbox_domains">virtual_mailbox_domains
</a></b>. The default
40 <i>nexthop
</i> destination is the recipient domain.
42 <b><a href=
"postconf.5.html#relay_transport">relay_transport
</a> (default: relay:)
</b>
43 This is the default for remote delivery to domains
44 listed with
<b><a href=
"postconf.5.html#relay_domains">relay_domains
</a></b>. In order of decreasing
45 precedence, the
<i>nexthop
</i> destination is taken from
46 <b><a href=
"postconf.5.html#relay_transport">relay_transport
</a></b>,
<b><a href=
"postconf.5.html#sender_dependent_relayhost_maps">sender_dependent_relayhost_maps
</a></b>,
47 <b><a href=
"postconf.5.html#relayhost">relayhost
</a></b>, or from the recipient domain.
49 <b><a href=
"postconf.5.html#default_transport">default_transport
</a> (default:
<a href=
"smtp.8.html">smtp
</a>:)
</b>
50 This is the default for remote delivery to other
51 destinations. In order of decreasing precedence,
52 the
<i>nexthop
</i> destination is taken from
53 <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>,
54 <b><a href=
"postconf.5.html#relayhost">relayhost
</a></b>, or from the recipient domain.
56 Normally, the
<a href=
"transport.5.html"><b>transport
</b>(
5)
</a> table is specified as a text
57 file that serves as input to the
<a href=
"postmap.1.html"><b>postmap
</b>(
1)
</a> command. The
58 result, an indexed file in
<b>dbm
</b> or
<b>db
</b> format, is used for
59 fast searching by the mail system. Execute the command
60 "<b>postmap /etc/postfix/transport</b>" to rebuild an indexed
61 file after changing the corresponding transport table.
63 When the table is provided via other means such as NIS,
64 LDAP or SQL, the same lookups are done as for ordinary
67 Alternatively, the table can be provided as a regular-
68 expression map where patterns are given as regular expres-
69 sions, or lookups can be directed to TCP-based server. In
70 those case, the lookups are done in a slightly different
71 way as described below under
"REGULAR EXPRESSION TABLES"
72 or
"TCP-BASED TABLES".
75 The search string is folded to lowercase before database
76 lookup. As of Postfix
2.3, the search string is not case
77 folded with database types such as
<a href=
"regexp_table.5.html">regexp
</a>: or
<a href=
"pcre_table.5.html">pcre
</a>: whose
78 lookup fields can match both upper and lower case.
81 The input format for the
<a href=
"postmap.1.html"><b>postmap
</b>(
1)
</a> command is as follows:
84 When
<i>pattern
</i> matches the recipient address or
85 domain, use the corresponding
<i>result
</i>.
87 blank lines and comments
88 Empty lines and whitespace-only lines are ignored,
89 as are lines whose first non-whitespace character
93 A logical line starts with non-whitespace text. A
94 line that starts with whitespace continues a logi-
97 The
<i>pattern
</i> specifies an email address, a domain name, or
98 a domain name hierarchy, as described in section
"TABLE
101 The
<i>result
</i> is of the form
<i>transport:nexthop
</i> and specifies
102 how or where to deliver mail. This is described in section
105 <b>TABLE SEARCH ORDER
</b>
106 With lookups from indexed files such as DB or DBM, or from
107 networked tables such as NIS, LDAP or SQL, patterns are
108 tried in the order as listed below:
110 <i>user+extension@domain transport
</i>:
<i>nexthop
</i>
111 Deliver mail for
<i>user+extension@domain
</i> through
112 <i>transport
</i> to
<i>nexthop
</i>.
114 <i>user@domain transport
</i>:
<i>nexthop
</i>
115 Deliver mail for
<i>user@domain
</i> through
<i>transport
</i> to
118 <i>domain transport
</i>:
<i>nexthop
</i>
119 Deliver mail for
<i>domain
</i> through
<i>transport
</i> to
<i>nex-
</i>
122 <i>.domain transport
</i>:
<i>nexthop
</i>
123 Deliver mail for any subdomain of
<i>domain
</i> through
124 <i>transport
</i> to
<i>nexthop
</i>. This applies only when the
125 string
<b><a href=
"postconf.5.html#transport_maps">transport_maps
</a></b> is not listed in the
<b><a href=
"postconf.5.html#parent_domain_matches_subdomains">par
</a>-
</b>
126 <b><a href=
"postconf.5.html#parent_domain_matches_subdomains">ent_domain_matches_subdomains
</a></b> configuration set-
127 ting. Otherwise, a domain name matches itself and
130 <b>*
</b> <i>transport
</i>:
<i>nexthop
</i>
131 The special pattern
<b>*
</b> represents any address (i.e.
132 it functions as the wild-card pattern, and is
133 unique to Postfix transport tables).
135 Note
1: the null recipient address is looked up as
136 <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-dae-
139 Note
2:
<i>user@domain
</i> or
<i>user+extension@domain
</i> lookup is
140 available in Postfix
2.0 and later.
143 The lookup result is of the form
<i>transport
</i><b>:
</b><i>nexthop
</i>. The
144 <i>transport
</i> field specifies a mail delivery transport such
145 as
<b>smtp
</b> or
<b>local
</b>. The
<i>nexthop
</i> field specifies where and
148 The transport field specifies the name of a mail delivery
149 transport (the first name of a mail delivery service entry
150 in the Postfix
<a href=
"master.5.html"><b>master.cf
</b></a> file).
152 The interpretation of the nexthop field is transport
153 dependent. In the case of SMTP, specify a service on a
154 non-default port as
<i>host
</i>:
<i>service
</i>, and disable MX (mail
155 exchanger) DNS lookups with [
<i>host
</i>] or [
<i>host
</i>]:
<i>port
</i>. The []
156 form is required when you specify an IP address instead of
159 A null
<i>transport
</i> and null
<i>nexthop
</i> result means
"do not
160 change": use the delivery transport and nexthop informa-
161 tion that would be used when the entire transport table
164 A non-null
<i>transport
</i> field with a null
<i>nexthop
</i> field
165 resets the nexthop information to the recipient domain.
167 A null
<i>transport
</i> field with non-null
<i>nexthop
</i> field does
168 not modify the transport information.
171 In order to deliver internal mail directly, while using a
172 mail relay for all other mail, specify a null entry for
173 internal destinations (do not change the delivery trans-
174 port or the nexthop information) and specify a wildcard
175 for all other destinations.
179 <b>*
<a href=
"smtp.8.html">smtp
</a>:outbound-relay.my.domain
</b>
181 In order to send mail for
<b>example.com
</b> and its subdomains
182 via the
<b>uucp
</b> transport to the UUCP host named
<b>example
</b>:
184 <b>example.com uucp:example
</b>
185 <b>.example.com uucp:example
</b>
187 When no nexthop host name is specified, the destination
188 domain name is used instead. For example, the following
189 directs mail for
<i>user
</i>@
<b>example.com
</b> via the
<b>slow
</b> transport
190 to a mail exchanger for
<b>example.com
</b>. The
<b>slow
</b> transport
191 could be configured to run at most one delivery process at
194 <b>example.com slow:
</b>
196 When no transport is specified, Postfix uses the transport
197 that matches the address domain class (see DESCRIPTION
198 above). The following sends all mail for
<b>example.com
</b> and
199 its subdomains to host
<b>gateway.example.com
</b>:
201 <b>example.com :[gateway.example.com]
</b>
202 <b>.example.com :[gateway.example.com]
</b>
204 In the above example, the [] suppress MX lookups. This
205 prevents mail routing loops when your machine is primary
206 MX host for
<b>example.com
</b>.
208 In the case of delivery via SMTP, one may specify
<i>host-
</i>
209 <i>name
</i>:
<i>service
</i> instead of just a host:
211 <b>example.com
<a href=
"smtp.8.html">smtp
</a>:bar.example:
2025</b>
213 This directs mail for
<i>user
</i>@
<b>example.com
</b> to host
<b>bar.example
</b>
214 port
<b>2025</b>. Instead of a numerical port a symbolic name may
215 be used. Specify [] around the hostname if MX lookups must
218 The error mailer can be used to bounce mail:
220 <b>.example.com
<a href=
"error.8.html">error
</a>:mail for *.example.com is not deliverable
</b>
222 This causes all mail for
<i>user
</i>@
<i>anything
</i><b>.example.com
</b> to be
225 <b>REGULAR EXPRESSION TABLES
</b>
226 This section describes how the table lookups change when
227 the table is given in the form of regular expressions. For
228 a description of regular expression lookup table syntax,
229 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>.
231 Each pattern is a regular expression that is applied to
232 the entire address being looked up. Thus,
233 <i>some.domain.hierarchy
</i> is not looked up via its parent
234 domains, nor is
<i>user+foo@domain
</i> looked up as
<i>user@domain
</i>.
236 Patterns are applied in the order as specified in the ta-
237 ble, until a pattern is found that matches the search
240 The
<a href=
"trivial-rewrite.8.html"><b>trivial-rewrite
</b>(
8)
</a> server disallows regular expression
241 substitution of $
1 etc. in regular expression lookup
242 tables, because that could open a security hole (Postfix
243 version
2.3 and later).
245 <b>TCP-BASED TABLES
</b>
246 This section describes how the table lookups change when
247 lookups are directed to a TCP-based server. For a descrip-
248 tion of the TCP client/server lookup protocol, see
<a href=
"tcp_table.5.html"><b>tcp_ta-
</b></a>
249 <a href=
"tcp_table.5.html"><b>ble
</b>(
5)
</a>. This feature is not available up to and including
252 Each lookup operation uses the entire recipient address
253 once. Thus,
<i>some.domain.hierarchy
</i> is not looked up via
254 its parent domains, nor is
<i>user+foo@domain
</i> looked up as
257 Results are the same as with indexed file lookups.
259 <b>CONFIGURATION PARAMETERS
</b>
260 The following
<a href=
"postconf.5.html"><b>main.cf
</b></a> parameters are especially relevant.
261 The text below provides only a parameter summary. See
262 <a href=
"postconf.5.html"><b>postconf
</b>(
5)
</a> for more details including examples.
264 <b><a href=
"postconf.5.html#empty_address_recipient">empty_address_recipient
</a></b>
265 The address that is looked up instead of the null
268 <b><a href=
"postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains
</a></b>
269 List of Postfix features that use
<i>domain.tld
</i> pat-
270 terns to match
<i>sub.domain.tld
</i> (as opposed to
271 requiring
<i>.domain.tld
</i> patterns).
273 <b><a href=
"postconf.5.html#transport_maps">transport_maps
</a></b>
274 List of transport lookup tables.
277 <a href=
"trivial-rewrite.8.html">trivial-rewrite(
8)
</a>, rewrite and resolve addresses
278 <a href=
"master.5.html">master(
5)
</a>,
<a href=
"master.5.html">master.cf
</a> file format
279 <a href=
"postconf.5.html">postconf(
5)
</a>, configuration parameters
280 <a href=
"postmap.1.html">postmap(
1)
</a>, Postfix lookup table manager
283 <a href=
"ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README
</a>, address rewriting guide
284 <a href=
"DATABASE_README.html">DATABASE_README
</a>, Postfix lookup table overview
285 <a href=
"FILTER_README.html">FILTER_README
</a>, external content filter
288 The Secure Mailer license must be distributed with this
293 IBM T.J. Watson Research
295 Yorktown Heights, NY
10598, USA
298 </pre> </body> </html>