xref: /netbsd-src/external/ibm-public/postfix/dist/html/transport.5.html (revision 10ad5ffa714ce1a679dcc9dd8159648df2d67b5a)
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 - transport(5) </title>
6</head> <body> <pre>
7TRANSPORT(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> &lt;<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
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.
26
27       This  mapping  overrides  the  default   <i>transport</i>:<i>nexthop</i>
28       selection that is built into Postfix:
29
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
35              is the MTA hostname.
36
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.
41
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.
48
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.
55
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.
62
63       When the table is provided via other means  such  as  NIS,
64       LDAP  or  SQL,  the  same lookups are done as for ordinary
65       indexed files.
66
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".
73
74<b>CASE FOLDING</b>
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.
79
80<b>TABLE FORMAT</b>
81       The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows:
82
83       <i>pattern result</i>
84              When  <i>pattern</i>  matches  the  recipient  address  or
85              domain, use the corresponding <i>result</i>.
86
87       blank lines and comments
88              Empty lines and whitespace-only lines are  ignored,
89              as  are  lines whose first non-whitespace character
90              is a `#'.
91
92       multi-line text
93              A logical line starts with non-whitespace  text.  A
94              line  that starts with whitespace continues a logi-
95              cal line.
96
97       The <i>pattern</i> specifies an email address, a domain name,  or
98       a  domain  name  hierarchy, as described in section "TABLE
99       LOOKUP".
100
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
103       "RESULT FORMAT".
104
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:
109
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>.
113
114       <i>user@domain transport</i>:<i>nexthop</i>
115              Deliver  mail  for <i>user@domain</i> through <i>transport</i> to
116              <i>nexthop</i>.
117
118       <i>domain transport</i>:<i>nexthop</i>
119              Deliver mail for <i>domain</i> through <i>transport</i>  to  <i>nex-</i>
120              <i>thop</i>.
121
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
128              its subdomains.
129
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).
134
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-
137       mon@hostname).
138
139       Note 2: <i>user@domain</i>  or  <i>user+extension@domain</i>  lookup  is
140       available in Postfix 2.0 and later.
141
142<b>RESULT FORMAT</b>
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
146       how to deliver mail.
147
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).
151
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
157       a hostname.
158
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
162       did not exist.
163
164       A non-null <i>transport</i>  field  with  a  null  <i>nexthop</i>  field
165       resets the nexthop information to the recipient domain.
166
167       A  null  <i>transport</i>  field with non-null <i>nexthop</i> field does
168       not modify the transport information.
169
170<b>EXAMPLES</b>
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.
176
177            <b>my.domain    :</b>
178            <b>.my.domain   :</b>
179            <b>*            <a href="smtp.8.html">smtp</a>:outbound-relay.my.domain</b>
180
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>:
183
184            <b>example.com      uucp:example</b>
185            <b>.example.com     uucp:example</b>
186
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
192       a time:
193
194            <b>example.com      slow:</b>
195
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>:
200
201            <b>example.com      :[gateway.example.com]</b>
202            <b>.example.com     :[gateway.example.com]</b>
203
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>.
207
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:
210
211            <b>example.com      <a href="smtp.8.html">smtp</a>:bar.example:2025</b>
212
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
216       be disabled.
217
218       The error mailer can be used to bounce mail:
219
220            <b>.example.com     <a href="error.8.html">error</a>:mail for *.example.com is not deliverable</b>
221
222       This  causes  all mail for <i>user</i>@<i>anything</i><b>.example.com</b> to be
223       bounced.
224
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>.
230
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>.
235
236       Patterns  are applied in the order as specified in the ta-
237       ble, until a pattern is  found  that  matches  the  search
238       string.
239
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).
244
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
250       Postfix version 2.4.
251
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
255       <i>user@domain</i>.
256
257       Results are the same as with indexed file lookups.
258
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.
263
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
266              sender address.
267
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).
272
273       <b><a href="postconf.5.html#transport_maps">transport_maps</a></b>
274              List of transport lookup tables.
275
276<b>SEE ALSO</b>
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
281
282<b>README FILES</b>
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
286
287<b>LICENSE</b>
288       The  Secure  Mailer  license must be distributed with this
289       software.
290
291<b>AUTHOR(S)</b>
292       Wietse Venema
293       IBM T.J. Watson Research
294       P.O. Box 704
295       Yorktown Heights, NY 10598, USA
296
297                                                                  TRANSPORT(5)
298</pre> </body> </html>
299