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