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