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