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