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