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=utf-8"> 5<link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6<title> Postfix manual - generic(5) </title> 7</head> <body> <pre> 8GENERIC(5) GENERIC(5) 9 10<b>NAME</b> 11 generic - Postfix generic table format 12 13<b>SYNOPSIS</b> 14 <b>postmap /etc/postfix/generic</b> 15 16 <b>postmap -q "</b><i>string</i><b>" /etc/postfix/generic</b> 17 18 <b>postmap -q - /etc/postfix/generic</b> <<i>inputfile</i> 19 20<b>DESCRIPTION</b> 21 The optional <a href="generic.5.html"><b>generic</b>(5)</a> table specifies an address mapping that applies 22 when mail is delivered. This is the opposite of <a href="canonical.5.html"><b>canonical</b>(5)</a> mapping, 23 which applies when mail is received. 24 25 Typically, one would use the <a href="generic.5.html"><b>generic</b>(5)</a> table on a system that does not 26 have a valid Internet domain name and that uses something like <i>localdo-</i> 27 <i>main.local</i> instead. The <a href="generic.5.html"><b>generic</b>(5)</a> table is then used by the <a href="smtp.8.html"><b>smtp</b>(8)</a> 28 client to transform local mail addresses into valid Internet mail 29 addresses when mail has to be sent across the Internet. See the EXAM- 30 PLE section at the end of this document. 31 32 The <a href="generic.5.html"><b>generic</b>(5)</a> mapping affects both message header addresses (i.e. 33 addresses that appear inside messages) and message envelope addresses 34 (for example, the addresses that are used in SMTP protocol commands). 35 36 Normally, the <a href="generic.5.html"><b>generic</b>(5)</a> table is specified as a text file that serves 37 as input to the <a href="postmap.1.html"><b>postmap</b>(1)</a> command. The result, an indexed file in <b>dbm</b> 38 or <b>db</b> format, is used for fast searching by the mail system. Execute 39 the command "<b>postmap /etc/postfix/generic</b>" to rebuild an indexed file 40 after changing the corresponding text file. 41 42 When the table is provided via other means such as NIS, LDAP or SQL, 43 the same lookups are done as for ordinary indexed files. 44 45 Alternatively, the table can be provided as a regular-expression map 46 where patterns are given as regular expressions, or lookups can be 47 directed to a TCP-based server. In those cases, the lookups are done in 48 a slightly different way as described below under "REGULAR EXPRESSION 49 TABLES" or "TCP-BASED TABLES". 50 51<b>CASE FOLDING</b> 52 The search string is folded to lowercase before database lookup. As of 53 Postfix 2.3, the search string is not case folded with database types 54 such as <a href="regexp_table.5.html">regexp</a>: or <a href="pcre_table.5.html">pcre</a>: whose lookup fields can match both upper and 55 lower case. 56 57<b>TABLE FORMAT</b> 58 The input format for the <a href="postmap.1.html"><b>postmap</b>(1)</a> command is as follows: 59 60 <i>pattern result</i> 61 When <i>pattern</i> matches a mail address, replace it by the corre- 62 sponding <i>result</i>. 63 64 blank lines and comments 65 Empty lines and whitespace-only lines are ignored, as are lines 66 whose first non-whitespace character is a `#'. 67 68 multi-line text 69 A logical line starts with non-whitespace text. A line that 70 starts with whitespace continues a logical line. 71 72<b>TABLE SEARCH ORDER</b> 73 With lookups from indexed files such as DB or DBM, or from networked 74 tables such as NIS, LDAP or SQL, each <i>user</i>@<i>domain</i> query produces a 75 sequence of query patterns as described below. 76 77 Each query pattern is sent to each specified lookup table before trying 78 the next query pattern, until a match is found. 79 80 <i>user</i>@<i>domain address</i> 81 Replace <i>user</i>@<i>domain</i> by <i>address</i>. This form has the highest prece- 82 dence. 83 84 <i>user address</i> 85 Replace <i>user</i>@<i>site</i> by <i>address</i> when <i>site</i> is equal to $<b><a href="postconf.5.html#myorigin">myorigin</a></b>, 86 when <i>site</i> is listed in $<b><a href="postconf.5.html#mydestination">mydestination</a></b>, or when it is listed in 87 $<b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a></b> or $<b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a></b>. 88 89 @<i>domain address</i> 90 Replace other addresses in <i>domain</i> by <i>address</i>. This form has the 91 lowest precedence. 92 93<b>RESULT ADDRESS REWRITING</b> 94 The lookup result is subject to address rewriting: 95 96 <b>o</b> When the result has the form @<i>otherdomain</i>, the result becomes 97 the same <i>user</i> in <i>otherdomain</i>. 98 99 <b>o</b> When "<b><a href="postconf.5.html#append_at_myorigin">append_at_myorigin</a>=yes</b>", append "<b>@$<a href="postconf.5.html#myorigin">myorigin</a></b>" to addresses 100 without "@domain". 101 102 <b>o</b> When "<b><a href="postconf.5.html#append_dot_mydomain">append_dot_mydomain</a>=yes</b>", append "<b>.$<a href="postconf.5.html#mydomain">mydomain</a></b>" to addresses 103 without ".domain". 104 105<b>ADDRESS EXTENSION</b> 106 When a mail address localpart contains the optional recipient delimiter 107 (e.g., <i>user+foo</i>@<i>domain</i>), the lookup order becomes: <i>user+foo</i>@<i>domain</i>, 108 <i>user</i>@<i>domain</i>, <i>user+foo</i>, <i>user</i>, and @<i>domain</i>. 109 110 The <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a></b> parameter controls whether an 111 unmatched address extension (<i>+foo</i>) is propagated to the result of table 112 lookup. 113 114<b>REGULAR EXPRESSION TABLES</b> 115 This section describes how the table lookups change when the table is 116 given in the form of regular expressions. For a description of regular 117 expression lookup table syntax, 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>. 118 119 Each pattern is a regular expression that is applied to the entire 120 address being looked up. Thus, <i>user@domain</i> mail addresses are not bro- 121 ken up into their <i>user</i> and <i>@domain</i> constituent parts, nor is <i>user+foo</i> 122 broken up into <i>user</i> and <i>foo</i>. 123 124 Patterns are applied in the order as specified in the table, until a 125 pattern is found that matches the search string. 126 127 Results are the same as with indexed file lookups, with the additional 128 feature that parenthesized substrings from the pattern can be interpo- 129 lated as <b>$1</b>, <b>$2</b> and so on. 130 131<b>TCP-BASED TABLES</b> 132 This section describes how the table lookups change when lookups are 133 directed to a TCP-based server. For a description of the TCP 134 client/server lookup protocol, see <a href="tcp_table.5.html"><b>tcp_table</b>(5)</a>. This feature is 135 available in Postfix 2.5 and later. 136 137 Each lookup operation uses the entire address once. Thus, <i>user@domain</i> 138 mail addresses are not broken up into their <i>user</i> and <i>@domain</i> con- 139 stituent parts, nor is <i>user+foo</i> broken up into <i>user</i> and <i>foo</i>. 140 141 Results are the same as with indexed file lookups. 142 143<b>EXAMPLE</b> 144 The following shows a generic mapping with an indexed file. When mail 145 is sent to a remote host via SMTP, this replaces <i>his@localdomain.local</i> 146 by his ISP mail address, replaces <i>her@localdomain.local</i> by her ISP mail 147 address, and replaces other local addresses by his ISP account, with an 148 address extension of <i>+local</i> (this example assumes that the ISP supports 149 "+" style address extensions). 150 151 /etc/postfix/<a href="postconf.5.html">main.cf</a>: 152 <a href="postconf.5.html#smtp_generic_maps">smtp_generic_maps</a> = <a href="DATABASE_README.html#types">hash</a>:/etc/postfix/generic 153 154 /etc/postfix/generic: 155 his@localdomain.local hisaccount@hisisp.example 156 her@localdomain.local heraccount@herisp.example 157 @localdomain.local hisaccount+local@hisisp.example 158 159 Execute the command "<b>postmap /etc/postfix/generic</b>" whenever the table 160 is changed. Instead of <b>hash</b>, some systems use <b>dbm</b> database files. To 161 find out what tables your system supports use the command "<b>postconf</b> 162 <b>-m</b>". 163 164<b>BUGS</b> 165 The table format does not understand quoting conventions. 166 167<b>CONFIGURATION PARAMETERS</b> 168 The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant. The text 169 below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more 170 details including examples. 171 172 <b><a href="postconf.5.html#smtp_generic_maps">smtp_generic_maps</a> (empty)</b> 173 Optional lookup tables that perform address rewriting in the 174 Postfix SMTP client, typically to transform a locally valid 175 address into a globally valid address when sending mail across 176 the Internet. 177 178 <b><a href="postconf.5.html#propagate_unmatched_extensions">propagate_unmatched_extensions</a> (canonical, virtual)</b> 179 What address lookup tables copy an address extension from the 180 lookup key to the lookup result. 181 182 Other parameters of interest: 183 184 <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> (all)</b> 185 The network interface addresses that this mail system receives 186 mail on. 187 188 <b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> (empty)</b> 189 The network interface addresses that this mail system receives 190 mail on by way of a proxy or network address translation unit. 191 192 <b><a href="postconf.5.html#mydestination">mydestination</a> ($<a href="postconf.5.html#myhostname">myhostname</a>, localhost.$<a href="postconf.5.html#mydomain">mydomain</a>, localhost)</b> 193 The list of domains that are delivered via the $<a href="postconf.5.html#local_transport">local_transport</a> 194 mail delivery transport. 195 196 <b><a href="postconf.5.html#myorigin">myorigin</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b> 197 The domain name that locally-posted mail appears to come from, 198 and that locally posted mail is delivered to. 199 200 <b><a href="postconf.5.html#owner_request_special">owner_request_special</a> (yes)</b> 201 Enable special treatment for owner-<i>listname</i> entries in the 202 <a href="aliases.5.html"><b>aliases</b>(5)</a> file, and don't split owner-<i>listname</i> and <i>list-</i> 203 <i>name</i>-request address localparts when the <a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> is 204 set to "-". 205 206<b>SEE ALSO</b> 207 <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager 208 <a href="postconf.5.html">postconf(5)</a>, configuration parameters 209 <a href="smtp.8.html">smtp(8)</a>, Postfix SMTP client 210 211<b>README FILES</b> 212 <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRITING_README</a>, address rewriting guide 213 <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview 214 <a href="STANDARD_CONFIGURATION_README.html">STANDARD_CONFIGURATION_README</a>, configuration examples 215 216<b>LICENSE</b> 217 The Secure Mailer license must be distributed with this software. 218 219<b>HISTORY</b> 220 A genericstable feature appears in the Sendmail MTA. 221 222 This feature is available in Postfix 2.2 and later. 223 224<b>AUTHOR(S)</b> 225 Wietse Venema 226 IBM T.J. Watson Research 227 P.O. Box 704 228 Yorktown Heights, NY 10598, USA 229 230 Wietse Venema 231 Google, Inc. 232 111 8th Avenue 233 New York, NY 10011, USA 234 235 GENERIC(5) 236</pre> </body> </html> 237