Seth Woolley's Man Viewer

transport(5) - transport - Postfix transport table format - man 5 transport

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

TRANSPORT(5)                                                      TRANSPORT(5)

       transport - Postfix transport table format

       postmap /etc/postfix/transport

       postmap -q "string(3,n)" /etc/postfix/transport

       postmap -q - /etc/postfix/transport <inputfile

       The   optional  transport(5)  table  specifies  a  mapping  from  email
       addresses to message delivery transports and/or relay hosts.  The  map-
       ping is used by the trivial-rewrite(8) daemon.

       This mapping overrides the default routing that is built into Postfix:

              A list of domains that is by default delivered via $local_trans-
              port. This also includes domains that match $inet_interfaces  or

              A  list  of  domains  that  is  by  default  delivered via $vir-

              A list of domains that is by default delivered via $relay_trans-

       any other destination
              Mail  for  any  other  destination  is  by default delivered via

       Normally, the transport(5) table is  specified  as  a  text  file(1,n)  that
       serves as input to the postmap(1) command.  The result, an indexed file(1,n)
       in(1,8) dbm or db format, is used for fast searching  by  the  mail(1,8)  system.
       Execute  the  command  "postmap  /etc/postfix/transport"  in(1,8)  order  to
       rebuild the indexed file(1,n) after changing the transport table.

       When the table is provided via other means such as NIS,  LDAP  or  SQL,
       the same lookups are done as for ordinary indexed files.

       Alternatively,  the  table  can be provided as a regular-expression map
       where patterns are given as regular  expressions,  or  lookups  can  be
       directed  to  TCP-based server. In that case, the lookups are done in(1,8) a
       slightly different way as described  below  under  "REGULAR  EXPRESSION

       The input format for the postmap(1) command is as follows:

       pattern result
              When  pattern  matches  the recipient address or domain, use the
              corresponding result.

       blank lines and comments
              Empty lines and whitespace-only lines are ignored, as are  lines
              whose first non-whitespace character is a `#'.

       multi-line text
              A  logical  line  starts  with  non-whitespace text. A line that
              starts with whitespace continues a logical line.

       The pattern specifies an email address, a domain name, or a domain name
       hierarchy, as described in(1,8) section "TABLE LOOKUP".

       The  result is of the form transport:nexthop and specifies how or where
       to deliver mail. This is described in(1,8) section "RESULT FORMAT".

       With lookups from indexed files such as DB or DBM,  or  from  networked
       tables  such  as  NIS,  LDAP or SQL, patterns are tried in(1,8) the order as
       listed below:

       user+extension@domain transport:nexthop
              Deliver mail(1,8) for user+extension@domain through transport to nex-

       user@domain transport:nexthop
              Deliver mail(1,8) for user@domain through transport to nexthop.

       domain transport:nexthop
              Deliver mail(1,8) for domain through transport to nexthop.

       .domain transport:nexthop
              Deliver  mail(1,8)  for  any subdomain of domain through transport to
              nexthop. This applies only when the string(3,n) transport_maps is not
              listed  in(1,8)  the  parent_domain_matches_subdomains  configuration
              setting.  Otherwise, a domain name matches itself and its subdo-

       Note 1: the special pattern * represents any address (i.e. it functions
       as the wild-card pattern).

       Note   2:   the   null   recipient   address   is    looked    up    as
       $empty_address_recipient@$myhostname (default: mailer-daemon@hostname).

       Note 3: user@domain or user+extension@domain  lookup  is  available  in(1,8)
       Postfix 2.0 and later.

       The  lookup  result  is  of  the form transport:nexthop.  The transport
       field specifies a mail(1,8) delivery transport such as smtp  or  local.  The
       nexthop field specifies where and how to deliver mail.

       The  transport  field  specifies  the name of a mail(1,8) delivery transport
       (the first name of a mail(1,8) delivery service entry in(1,8)  the  Postfix  mas- file(1,n)).

       The  interpretation of the nexthop field is transport dependent. In the
       case of SMTP, specify a service on a non-default port as  host(1,5):service,
       and disable MX (mail(1,8) exchanger) DNS lookups with [host(1,5)] or [host(1,5)]:port.
       The [] form is required when you specify an IP  address  instead  of  a

       A null transport and null nexthop result means "do not change": use the
       delivery transport and nexthop information that would be used when  the
       entire transport table did not exist.

       A non-null transport field with a null nexthop field resets the nexthop
       information to the recipient domain.

       A null transport field with non-null nexthop field does not modify  the
       transport information.

       In  order  to  deliver internal mail(1,8) directly, while using a mail(1,8) relay
       for all other mail(1,8), specify a null entry for internal destinations  (do
       not change the delivery transport or the nexthop information) and spec-
       ify a wildcard for all other destinations.

            my.domain    :
            .my.domain   :

       In order to send(2,n) mail(1,8) for and its subdomains via  the  uucp
       transport to the UUCP host(1,5) named(5,8) example:


       When  no nexthop host(1,5) name is specified, the destination domain name is
       used instead. For example, the following directs  mail(1,8)  for  user@exam-  via  the  slow  transport to a mail(1,8) exchanger for
       The slow transport could be configured to  run  at  most  one  delivery
       process at a time:


       When no transport is specified, Postfix uses the transport that matches
       the address domain class (see DESCRIPTION above).  The following  sends
       all  mail(1,8)  for  and  its  subdomains to host(1,5) gateway.exam-


       In the above example, the [] suppress MX lookups.  This  prevents  mail(1,8)
       routing loops when your machine is primary MX host(1,5) for

       In  the  case  of  delivery  via SMTP, one may specify hostname:service
       instead of just a host:


       This directs mail(1,8) for to host(1,5) bar.example  port  2025.
       Instead  of  a  numerical  port a symbolic name may be used. Specify []
       around the hostname if(3,n) MX lookups must be disabled.

       The error(8,n) mailer can be used to bounce mail:

       error:mail for * is not deliverable

       This causes all mail(1,8) for to be bounced.

       This section describes how the table lookups change when the  table  is
       given  in(1,8) the form of regular expressions. For a description of regular
       expression lookup table syntax, see regexp_table(5) or pcre_table(5).

       Each pattern is a regular expression that  is  applied  to  the  entire
       address  being  looked up. Thus, some.domain.hierarchy is not looked up
       via  its  parent  domains,  nor  is  user+foo@domain   looked   up   as

       Patterns  are  applied  in(1,8) the order as specified in(1,8) the table, until a
       pattern is found that matches the search string.

       Results are the same as with indexed file(1,n) lookups, with the  additional
       feature  that parenthesized substrings from the pattern can be interpo-
       lated as $1, $2 and so on.

       This section describes how the table lookups change  when  lookups  are
       directed   to  a  TCP-based  server.  For  a  description  of  the  TCP
       client/server lookup protocol, see tcp_table(5).  This feature  is  not
       available up to and including Postfix version(1,3,5) 2.2.

       Each  lookup  operation  uses the entire recipient address once.  Thus,
       some.domain.hierarchy is not looked up via its parent domains,  nor  is
       user+foo@domain looked up as user@domain.

       Results are the same as with indexed file(1,n) lookups.

       The  following  parameters  are especially relevant.  The text
       below provides only a  parameter  summary.  See  postconf(1,5)(5)  for  more
       details including examples.

              The  address  that  is  looked  up  instead  of  the null sender

              List of Postfix features that use domain.tld patterns  to  match
              sub.domain.tld (as opposed to requiring .domain.tld patterns).

              List of transport lookup tables.

       trivial-rewrite(8), rewrite and resolve addresses
       postconf(1,5)(5), configuration parameters
       postmap(1), Postfix lookup table manager

       Use  "postconf(1,5) readme_directory" or "postconf(1,5) html_directory" to locate
       this information.
       DATABASE_README, Postfix lookup table overview
       FILTER_README, external content filter(1,3x,3x curs_util)

       The Secure Mailer license must be distributed with this software.

       Wietse Venema
       IBM T.J. Watson Research
       P.O. Box 704
       Yorktown Heights, NY 10598, USA


References for this manual (incoming links)