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