1 <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "https://www.w3.org/TR/html4/loose.dtd"> 3 4 <html> 5 6 <head> 7 8 <title>Postfix Address Classes </title> 9 10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 11 <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 12 13 </head> 14 15 <body> 16 17 <h1><img src="postfix-logo.jpg" width="203" height="98" ALT="">Postfix Address Classes </h1> 18 19 <hr> 20 21 <h2>Introduction</h2> 22 23 <p> Postfix version 2.0 introduces the concept of address classes. 24 This is a way of grouping recipient addresses by their delivery 25 method. The idea comes from discussions with Victor Duchovni. 26 Although address classes introduced a few incompatibilities they 27 also made it possible to improve the handling of hosted domains 28 and of unknown recipients. </p> 29 30 <p> This document provides information on the following topics: </p> 31 32 <ul> 33 34 <li><a href="#wtf">What are address classes good for?</a> 35 36 <li><a href="#classes">What address classes does Postfix implement?</a> 37 38 <li><a href="#improvements">Improvements compared to Postfix 1.1</a> 39 40 <li><a href="#incompatibility">Incompatibilities with Postfix 1.1</a> 41 42 </ul> 43 44 <h2><a name="wtf">What are address classes good for?</a></h2> 45 46 <p> Why should you care about address classes? This is how Postfix 47 decides what mail to accept, and how to deliver it. In other words, 48 address classes are very important for the operation of Postfix. </p> 49 50 <p> An address class is defined by three items. </p> 51 52 <ul> 53 54 <li> <p> The list of domains that are a member of that address 55 class. </p> 56 57 <p> Examples: all local domains, or all relay domains. </p> 58 59 <li> <p> The default delivery transport for domains in that address 60 class. </p> 61 62 <p> Examples: local_transport or relay_transport (these point 63 to services defined in master.cf). </p> 64 65 <p> Benefit: this avoids the need for explicit routing information 66 in transport maps. </p> 67 68 <li> <p> The list of valid recipient addresses for that address 69 class. </p> 70 71 <p> Benefit: the Postfix SMTP server rejects an invalid recipient 72 with "User unknown in <name of address class> table", and 73 avoids sending a MAILER-DAEMON message with backscatter spam. </p> 74 75 </ul> 76 77 <h2><a name="classes">What address classes does Postfix implement?</a></h2> 78 79 <p> Initially the list of address classes is hard coded, but this 80 is meant to become extensible. The summary below describes the main 81 purpose of each class, and what the relevant configuration parameters 82 are. </p> 83 84 <p> The <a name="local_domain_class">local </a> domain class. </p> 85 86 <ul> 87 88 <li> <p> Purpose: final delivery for traditional UNIX system accounts 89 and traditional Sendmail-style aliases. This is typically used for 90 the canonical domains of the machine (for example, $myhostname, 91 $mydomain). For a discussion of the 92 difference between canonical domains, hosted domains and other 93 domains, see the VIRTUAL_README file. </p> 94 95 <li> <p> Domain names are listed with the mydestination parameter. 96 This domain class also includes mail for <i>user@[ipaddress]</i> 97 when the IP address is listed with the inet_interfaces or 98 proxy_interfaces parameters. </p> 99 100 <li> <p> Valid recipient addresses for those domains are 101 listed with the local_recipient_maps parameter, as described in 102 LOCAL_RECIPIENT_README. The Postfix SMTP server rejects invalid recipients 103 with "User unknown in local recipient table". If the local_recipient_maps 104 parameter value is empty, then the Postfix SMTP server accepts any 105 address in the local domain class. </p> 106 107 <li> <p> The mail delivery transport is specified with the 108 local_transport parameter. The default value is <b>local:$myhostname</b> 109 for delivery with the local(8) delivery agent. </p> 110 111 </ul> 112 113 <p> The <a name="virtual_alias_class">virtual alias </a> domain 114 class. </p> 115 116 <ul> 117 118 <li> <p> Purpose: hosted domains where each recipient address is 119 aliased to an address in a different domain class, for example, a 120 local UNIX system account or a remote address. A 121 virtual alias example is given in the VIRTUAL_README file. </p> 122 123 <li> <p> Domain names are listed in virtual_alias_domains. The 124 default value is $virtual_alias_maps for Postfix 1.1 compatibility. 125 </p> 126 127 <li> <p> Valid recipient addresses for those domains are listed with the 128 virtual_alias_maps parameter. The Postfix SMTP server rejects invalid 129 recipients with "User unknown in virtual alias table". The default 130 value is $virtual_maps for Postfix 1.1 compatibility. </p> 131 132 <blockquote ><p> Note: for historical reasons, virtual_alias_maps 133 apply to recipients in all domain classes, not only the virtual 134 alias domain class. </p> </blockquote> 135 136 <li> <p> There is no configurable mail delivery transport. Every 137 address must be aliased to an address in some other domain class. </p> 138 139 </ul> 140 141 <p> The <a name="virtual_mailbox_class">virtual mailbox </a> domain 142 class. </p> 143 144 <ul> 145 146 <li> <p> Purpose: final delivery for hosted domains where each 147 recipient address can have its own mailbox, and where users do not 148 need to have a UNIX system account. A virtual mailbox example is 149 given in the VIRTUAL_README file. </p> 150 151 <li> <p> Domain names are listed with the virtual_mailbox_domains 152 parameter. The default value is $virtual_mailbox_maps for Postfix 153 1.1 compatibility. </p> 154 155 <li> <p> Valid recipient addresses for those domains are listed 156 with the virtual_mailbox_maps parameter. The Postfix SMTP server 157 rejects invalid recipients with "User unknown in virtual mailbox 158 table". If this parameter value is empty, the Postfix SMTP server 159 accepts all recipients for domains listed in $virtual_mailbox_domains. 160 </p> 161 162 <li> <p> The mail delivery transport is specified with the 163 virtual_transport parameter. The default value is <b>virtual</b> 164 for delivery with the virtual(8) delivery agent. </p> 165 166 </ul> 167 168 <p> The <a name="relay_domain_class">relay </a> domain class. </p> 169 170 <ul> 171 172 <li> <p> Purpose: mail forwarding to remote destinations that list 173 your system as primary or backup MX host. For a discussion of the 174 basic configuration details, see the BASIC_CONFIGURATION_README 175 document. For a discussion of the difference between canonical 176 domains, hosted domains and other domains, see the VIRTUAL_README 177 file. </p> 178 179 <li> <p> Domain names are listed with the relay_domains parameter. 180 </p> 181 182 <li> <p> Valid recipient addresses for those domains are listed 183 with the relay_recipient_maps parameter. The Postfix SMTP server 184 rejects invalid recipients with "User unknown in relay recipient 185 table". If this parameter value is empty, the Postfix SMTP server 186 accepts all recipients for domains listed with the relay_domains 187 parameter. </p> 188 189 <li> <p> The mail delivery transport is specified with the 190 relay_transport parameter. The default value is <b>relay</b> which 191 is a clone of the smtp(8) delivery agent. </p> 192 193 </ul> 194 195 <p> The <a name="default_domain_class">default </a> domain class. 196 </p> 197 198 <ul> 199 200 <li> <p> Purpose: mail forwarding to the Internet on behalf of 201 authorized clients. For a discussion of the basic configuration 202 details, see the BASIC_CONFIGURATION_README file. For a discussion 203 of the difference between canonical domains, hosted domains and 204 other domains, see the VIRTUAL_README file. </p> 205 206 <li> <p> This class has no destination domain table. </p> 207 208 <li> <p> This class has no valid recipient address table. </p> 209 210 <li> <p> The mail delivery transport is specified with the 211 default_transport parameter. The default value is <b>smtp</b> for 212 delivery with the smtp(8) delivery agent. </p> 213 214 </ul> 215 216 <h2><a name="improvements">Improvements compared to Postfix 217 1.1</a></h2> 218 219 <p> Postfix 2.0 address classes made the following improvements 220 possible over earlier Postfix versions: </p> 221 222 <ul> 223 224 <li> <p> You no longer need to specify all the virtual(8) mailbox 225 domains in the Postfix transport map. The virtual(8) delivery agent 226 has become a first-class citizen just like local(8) or smtp(8). 227 </p> 228 229 <li> <p> On mail gateway systems, address classes provide separation 230 of inbound mail relay traffic ($relay_transport) from outbound 231 traffic ($default_transport). This eliminates a problem where 232 inbound mail deliveries could become resource starved in the presence 233 of a high volume of outbound mail. </p> 234 235 <li> <p> The SMTP server rejects unknown recipients in a more 236 consistent manner than was possible with Postfix version 1. This 237 is needed to keep undeliverable mail (and bounced undeliverable 238 mail) out of the mail queue. This is controlled by the 239 smtpd_reject_unlisted_recipient configuration parameter. </p> 240 241 <li> <p> As of Postfix version 2.1, the SMTP server can also reject 242 unknown sender addresses (i.e. addresses that it would reject as 243 an unknown recipient addresses). Sender "egress filtering" can help 244 to slow down an email worm explosion. This is controlled by the 245 smtpd_reject_unlisted_sender configuration parameter. </p> 246 247 </ul> 248 249 <h2><a name="incompatibility">Incompatibilities with Postfix 1.1</a></h2> 250 251 <p> Postfix 2.0 address classes introduce a few incompatible changes 252 in documented behavior. In order to ease the transitions, new 253 parameters have default values that are backwards compatible. </p> 254 255 <ul> 256 257 <li> <p> The virtual_maps parameter is replaced by virtual_alias_maps 258 (for address lookups) and by virtual_alias_domains (for the names 259 of what were formerly called "Postfix-style virtual domains"). </p> 260 261 <p> For backwards compatibility with Postfix version 1.1, the new 262 virtual_alias_maps parameter defaults to $virtual_maps, and the 263 new virtual_alias_domains parameter defaults to $virtual_alias_maps. 264 </p> 265 266 <li> <p> The virtual_mailbox_maps parameter now has a companion 267 parameter called virtual_mailbox_domains (for the names of domains 268 served by the virtual delivery agent). The virtual_mailbox_maps 269 parameter is now used for address lookups only. </p> 270 271 <p> For backwards compatibility with Postfix version 1.1, the new 272 virtual_mailbox_domains parameter defaults to $virtual_mailbox_maps. 273 </p> 274 275 <li> <p> Introduction of the relay_recipient_maps parameter. The 276 Postfix SMTP server can use this to block mail for relay recipients 277 that don't exist. This list is empty by default, which means accept 278 any recipient. </p> 279 280 <li> <p> The local_recipient_maps feature is now turned on by 281 default. The Postfix SMTP server uses this to reject mail for 282 unknown local recipients. See the LOCAL_RECIPIENT_README file hints 283 and tips. </p> 284 285 <li> <p> Introduction of the relay delivery transport in master.cf. 286 This helps to avoid mail delivery scheduling problems on inbound 287 mail relays when there is a lot of outbound mail, but may require 288 that you update your "defer_transports" setting. </p> 289 290 </ul> 291 292 </body> 293 294 </html> 295