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