NAME

transport - Postfix transport table format

SYNOPSIS


ppoossttmmaapp //eettcc//ppoossttffiixx//ttrraannssppoorrtt

ppoossttmmaapp --qq ""_s_t_r_i_n_g"" //eettcc//ppoossttffiixx//ttrraannssppoorrtt

ppoossttmmaapp --qq -- //eettcc//ppoossttffiixx//ttrraannssppoorrtt <<_i_n_p_u_t_f_i_l_e

DESCRIPTION

The optional ttrraannssppoorrtt(5) table specifies a mapping from email addresses to message delivery transports and next-hop destinations. Message delivery transports such as llooccaall or ssmmttpp are defined in the mmaasstteerr..ccff file, and next-hop destinations are typically hosts or domain names. The table is searched by the ttrriivviiaall--rreewwrriittee(8) daemon.

This mapping overrides the default _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p selection that is built into Postfix:

llooccaall__ttrraannssppoorrtt ((ddeeffaauulltt:: llooccaall::$$mmyyhhoossttnnaammee)) This is the default for final delivery to domains listed
with mmyyddeessttiinnaattiioonn, and for [_i_p_a_d_d_r_e_s_s] destinations that match $$iinneett__iinntteerrffaacceess or $$pprrooxxyy__iinntteerrffaacceess. The default _n_e_x_t_h_o_p destination is the MTA hostname.
vviirrttuuaall__ttrraannssppoorrtt ((ddeeffaauulltt:: vviirrttuuaall::)) This is the default for final delivery to domains listed
with vviirrttuuaall__mmaaiillbbooxx__ddoommaaiinnss. The default _n_e_x_t_h_o_p destination is the recipient domain.
rreellaayy__ttrraannssppoorrtt ((ddeeffaauulltt:: rreellaayy::)) This is the default for remote delivery to domains listed
with rreellaayy__ddoommaaiinnss. In order of decreasing precedence, the _n_e_x_t_h_o_p destination is taken from rreellaayy__ttrraannssppoorrtt, sseennddeerr__ddeeppeennddeenntt__rreellaayyhhoosstt__mmaappss, rreellaayyhhoosstt, or from the recipient domain.
ddeeffaauulltt__ttrraannssppoorrtt ((ddeeffaauulltt:: ssmmttpp::)) This is the default for remote delivery to other destinations.
In order of decreasing precedence, the _n_e_x_t_h_o_p destination is taken from ddeeffaauulltt__ttrraannssppoorrtt, sseennddeerr__ddeeppeennddeenntt__rreellaayyhhoosstt__mmaappss, rreellaayyhhoosstt, or from the recipient domain.

Normally, the ttrraannssppoorrtt(5) table is specified as a text file that serves as input to the ppoossttmmaapp(1) command. The result, an indexed file in ddbbmm or ddbb format, is used for fast searching by the mail system. Execute the command "ppoossttmmaapp //eettcc//ppoossttffiixx//ttrraannssppoorrtt" to rebuild an indexed file after changing the corresponding 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 those case, the lookups are done in a slightly different way as described below under "REGULAR EXPRESSION TABLES" or "TCP-BASED TABLES".

CASE FOLDING



The search string is folded to lowercase before database
lookup. As of Postfix 2.3, the search string is not case
folded with database types such as regexp: or pcre: whose
lookup fields can match both upper and lower case.

TABLE FORMAT



The input format for the ppoossttmmaapp(1) command is as follows:
_p_a_t_t_e_r_n _r_e_s_u_l_t When _p_a_t_t_e_r_n matches the recipient address or domain, use the
corresponding _r_e_s_u_l_t.
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 _p_a_t_t_e_r_n specifies an email address, a domain name, or a domain name hierarchy, as described in section "TABLE LOOKUP".

The _r_e_s_u_l_t is of the form _t_r_a_n_s_p_o_r_t_:_n_e_x_t_h_o_p and specifies how or where to deliver mail. This is described in 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 the order as
listed below:
_u_s_e_r_+_e_x_t_e_n_s_i_o_n_@_d_o_m_a_i_n _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p Deliver mail for _u_s_e_r_+_e_x_t_e_n_s_i_o_n_@_d_o_m_a_i_n through
_t_r_a_n_s_p_o_r_t to _n_e_x_t_h_o_p.
_u_s_e_r_@_d_o_m_a_i_n _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p Deliver mail for _u_s_e_r_@_d_o_m_a_i_n through _t_r_a_n_s_p_o_r_t to
_n_e_x_t_h_o_p.
_d_o_m_a_i_n _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p Deliver mail for _d_o_m_a_i_n through _t_r_a_n_s_p_o_r_t to
_n_e_x_t_h_o_p.
_._d_o_m_a_i_n _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p Deliver mail for any subdomain of _d_o_m_a_i_n through
_t_r_a_n_s_p_o_r_t to _n_e_x_t_h_o_p. This applies only when the string ttrraannssppoorrtt__mmaappss is not listed in the ppaarreenntt__ddoommaaiinn__mmaattcchheess__ssuubbddoommaaiinnss configuration setting. Otherwise, a domain name matches itself and its subdomains.
** _t_r_a_n_s_p_o_r_t:_n_e_x_t_h_o_p The special pattern ** represents any address (i.e. it
functions as the wild-card pattern, and is unique to Postfix transport tables).

Note 1: the null recipient address is looked up as $$eemmppttyy__aaddddrreessss__rreecciippiieenntt@$$mmyyhhoossttnnaammee (default: mailer-daemon@hostname).

Note 2: _u_s_e_r_@_d_o_m_a_i_n or _u_s_e_r_+_e_x_t_e_n_s_i_o_n_@_d_o_m_a_i_n lookup is available in Postfix 2.0 and later.

RESULT FORMAT



The lookup result is of the form _t_r_a_n_s_p_o_r_t::_n_e_x_t_h_o_p.
The _t_r_a_n_s_p_o_r_t field specifies a mail delivery transport
such as ssmmttpp or llooccaall. The _n_e_x_t_h_o_p field
specifies where and how to deliver mail.
        

The transport field specifies the name of a mail delivery transport (the first name of a mail delivery service entry in the Postfix mmaasstteerr..ccff file).

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

A null _t_r_a_n_s_p_o_r_t and null _n_e_x_t_h_o_p 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 _t_r_a_n_s_p_o_r_t field with a null _n_e_x_t_h_o_p field resets the nexthop information to the recipient domain.

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

EXAMPLES



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


     mmyy..ddoommaaiinn    ::
     ..mmyy..ddoommaaiinn   ::
     **            ssmmttpp::oouuttbboouunndd--rreellaayy..mmyy..ddoommaaiinn

In order to send mail for eexxaammppllee..ccoomm and its subdomains via the uuuuccpp transport to the UUCP host named eexxaammppllee:


     eexxaammppllee..ccoomm      uuuuccpp::eexxaammppllee
     ..eexxaammppllee..ccoomm     uuuuccpp::eexxaammppllee

When no nexthop host name is specified, the destination domain name is used instead. For example, the following directs mail for _u_s_e_r@eexxaammppllee..ccoomm via the ssllooww transport to a mail exchanger for eexxaammppllee..ccoomm. The ssllooww transport could be configured to run at most one delivery process at a time:


     eexxaammppllee..ccoomm      ssllooww::

When no transport is specified, Postfix uses the transport that matches the address domain class (see DESCRIPTION above). The following sends all mail for eexxaammppllee..ccoomm and its subdomains to host ggaatteewwaayy..eexxaammppllee..ccoomm:


     eexxaammppllee..ccoomm      ::[[ggaatteewwaayy..eexxaammppllee..ccoomm]]
     ..eexxaammppllee..ccoomm     ::[[ggaatteewwaayy..eexxaammppllee..ccoomm]]

In the above example, the [] suppress MX lookups. This prevents mail routing loops when your machine is primary MX host for eexxaammppllee..ccoomm.

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


     eexxaammppllee..ccoomm      ssmmttpp::bbaarr..eexxaammppllee::22002255

This directs mail for _u_s_e_r@eexxaammppllee..ccoomm to host bbaarr..eexxaammppllee port 22002255. Instead of a numerical port a symbolic name may be used. Specify [] around the hostname if MX lookups must be disabled.

The error mailer can be used to bounce mail:


     ..eexxaammppllee..ccoomm     eerrrroorr::mmaaiill ffoorr **..eexxaammppllee..ccoomm iiss nnoott ddeelliivveerraabbllee

This causes all mail for _u_s_e_r@_a_n_y_t_h_i_n_g..eexxaammppllee..ccoomm to be bounced.

REGULAR EXPRESSION TABLES



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

Each pattern is a regular expression that is applied to the entire address being looked up. Thus, _s_o_m_e_._d_o_m_a_i_n_._h_i_e_r_a_r_c_h_y is not looked up via its parent domains, nor is _u_s_e_r_+_f_o_o_@_d_o_m_a_i_n looked up as _u_s_e_r_@_d_o_m_a_i_n.

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

The ttrriivviiaall--rreewwrriittee(8) server disallows regular expression substitution of $1 etc. in regular expression lookup tables, because that could open a security hole (Postfix version 2.3 and later).

TCP-BASED TABLES



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 ttccpp__ttaabbllee(5).
This feature is not available up to and including Postfix version 2.4.
        

Each lookup operation uses the entire recipient address once. Thus, _s_o_m_e_._d_o_m_a_i_n_._h_i_e_r_a_r_c_h_y is not looked up via its parent domains, nor is _u_s_e_r_+_f_o_o_@_d_o_m_a_i_n looked up as _u_s_e_r_@_d_o_m_a_i_n.

Results are the same as with indexed file lookups.

CONFIGURATION PARAMETERS



The following mmaaiinn..ccff parameters are especially relevant.
The text below provides only a parameter summary. See
ppoossttccoonnff(5) for more details including examples.
eemmppttyy__aaddddrreessss__rreecciippiieenntt The address that is looked up instead of the null sender address.
ppaarreenntt__ddoommaaiinn__mmaattcchheess__ssuubbddoommaaiinnss List of Postfix features that use _d_o_m_a_i_n_._t_l_d patterns
to match _s_u_b_._d_o_m_a_i_n_._t_l_d (as opposed to requiring _._d_o_m_a_i_n_._t_l_d patterns).
ttrraannssppoorrtt__mmaappss List of transport lookup tables.

SEE ALSO


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

README FILES



Use "ppoossttccoonnff rreeaaddmmee__ddiirreeccttoorryy" or
"ppoossttccoonnff hhttmmll__ddiirreeccttoorryy" to locate this information.

ADDRESS_REWRITING_README, address rewriting guide
DATABASE_README, Postfix lookup table overview
FILTER_README, external content filter

LICENSE



The Secure Mailer license must be distributed with this software.

AUTHOR(S)


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