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