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. 24This is a way of grouping recipient addresses by their delivery 25method. The idea comes from discussions with Victor Duchovni. 26Although address classes introduced a few incompatibilities they 27also made it possible to improve the handling of hosted domains 28and 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 47decides what mail to accept, and how to deliver it. In other words, 48address 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 55class. </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 60class. </p> 61 62<p> Examples: local_transport or relay_transport (these point 63to services defined in master.cf). </p> 64 65<p> Benefit: this avoids the need for explicit routing information 66in transport maps. </p> 67 68<li> <p> The list of valid recipient addresses for that address 69class. </p> 70 71<p> Benefit: the Postfix SMTP server rejects an invalid recipient 72with "User unknown in <name of address class> table", and 73avoids 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 80is meant to become extensible. The summary below describes the main 81purpose of each class, and what the relevant configuration parameters 82are. </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 89and traditional Sendmail-style aliases. This is typically used for 90the canonical domains of the machine (for example, $myhostname, 91$mydomain). For a discussion of the 92difference between canonical domains, hosted domains and other 93domains, see the VIRTUAL_README file. </p> 94 95<li> <p> Domain names are listed with the mydestination parameter. 96This domain class also includes mail for <i>user@[ipaddress]</i> 97when the IP address is listed with the inet_interfaces or 98proxy_interfaces parameters. </p> 99 100<li> <p> Valid recipient addresses for those domains are 101listed with the local_recipient_maps parameter, as described in 102LOCAL_RECIPIENT_README. The Postfix SMTP server rejects invalid recipients 103with "User unknown in local recipient table". If the local_recipient_maps 104parameter value is empty, then the Postfix SMTP server accepts any 105address in the local domain class. </p> 106 107<li> <p> The mail delivery transport is specified with the 108local_transport parameter. The default value is <b>local:$myhostname</b> 109for delivery with the local(8) delivery agent. </p> 110 111</ul> 112 113<p> The <a name="virtual_alias_class">virtual alias </a> domain 114class. </p> 115 116<ul> 117 118<li> <p> Purpose: hosted domains where each recipient address is 119aliased to an address in a different domain class, for example, a 120local UNIX system account or a remote address. A 121virtual alias example is given in the VIRTUAL_README file. </p> 122 123<li> <p> Domain names are listed in virtual_alias_domains. The 124default 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 128virtual_alias_maps parameter. The Postfix SMTP server rejects invalid 129recipients with "User unknown in virtual alias table". The default 130value is $virtual_maps for Postfix 1.1 compatibility. </p> 131 132<blockquote ><p> Note: for historical reasons, virtual_alias_maps 133apply to recipients in all domain classes, not only the virtual 134alias domain class. </p> </blockquote> 135 136<li> <p> There is no configurable mail delivery transport. Every 137address 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 142class. </p> 143 144<ul> 145 146<li> <p> Purpose: final delivery for hosted domains where each 147recipient address can have its own mailbox, and where users do not 148need to have a UNIX system account. A virtual mailbox example is 149given in the VIRTUAL_README file. </p> 150 151<li> <p> Domain names are listed with the virtual_mailbox_domains 152parameter. The default value is $virtual_mailbox_maps for Postfix 1531.1 compatibility. </p> 154 155<li> <p> Valid recipient addresses for those domains are listed 156with the virtual_mailbox_maps parameter. The Postfix SMTP server 157rejects invalid recipients with "User unknown in virtual mailbox 158table". If this parameter value is empty, the Postfix SMTP server 159accepts all recipients for domains listed in $virtual_mailbox_domains. 160</p> 161 162<li> <p> The mail delivery transport is specified with the 163virtual_transport parameter. The default value is <b>virtual</b> 164for 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 173your system as primary or backup MX host. For a discussion of the 174basic configuration details, see the BASIC_CONFIGURATION_README 175document. For a discussion of the difference between canonical 176domains, hosted domains and other domains, see the VIRTUAL_README 177file. </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 183with the relay_recipient_maps parameter. The Postfix SMTP server 184rejects invalid recipients with "User unknown in relay recipient 185table". If this parameter value is empty, the Postfix SMTP server 186accepts all recipients for domains listed with the relay_domains 187parameter. </p> 188 189<li> <p> The mail delivery transport is specified with the 190relay_transport parameter. The default value is <b>relay</b> which 191is 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 201authorized clients. For a discussion of the basic configuration 202details, see the BASIC_CONFIGURATION_README file. For a discussion 203of the difference between canonical domains, hosted domains and 204other 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 211default_transport parameter. The default value is <b>smtp</b> for 212delivery with the smtp(8) delivery agent. </p> 213 214</ul> 215 216<h2><a name="improvements">Improvements compared to Postfix 2171.1</a></h2> 218 219<p> Postfix 2.0 address classes made the following improvements 220possible over earlier Postfix versions: </p> 221 222<ul> 223 224<li> <p> You no longer need to specify all the virtual(8) mailbox 225domains in the Postfix transport map. The virtual(8) delivery agent 226has 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 230of inbound mail relay traffic ($relay_transport) from outbound 231traffic ($default_transport). This eliminates a problem where 232inbound mail deliveries could become resource starved in the presence 233of a high volume of outbound mail. </p> 234 235<li> <p> The SMTP server rejects unknown recipients in a more 236consistent manner than was possible with Postfix version 1. This 237is needed to keep undeliverable mail (and bounced undeliverable 238mail) out of the mail queue. This is controlled by the 239smtpd_reject_unlisted_recipient configuration parameter. </p> 240 241<li> <p> As of Postfix version 2.1, the SMTP server can also reject 242unknown sender addresses (i.e. addresses that it would reject as 243an unknown recipient addresses). Sender "egress filtering" can help 244to slow down an email worm explosion. This is controlled by the 245smtpd_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 252in documented behavior. In order to ease the transitions, new 253parameters 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 259of what were formerly called "Postfix-style virtual domains"). </p> 260 261<p> For backwards compatibility with Postfix version 1.1, the new 262virtual_alias_maps parameter defaults to $virtual_maps, and the 263new virtual_alias_domains parameter defaults to $virtual_alias_maps. 264</p> 265 266<li> <p> The virtual_mailbox_maps parameter now has a companion 267parameter called virtual_mailbox_domains (for the names of domains 268served by the virtual delivery agent). The virtual_mailbox_maps 269parameter is now used for address lookups only. </p> 270 271<p> For backwards compatibility with Postfix version 1.1, the new 272virtual_mailbox_domains parameter defaults to $virtual_mailbox_maps. 273</p> 274 275<li> <p> Introduction of the relay_recipient_maps parameter. The 276Postfix SMTP server can use this to block mail for relay recipients 277that don't exist. This list is empty by default, which means accept 278any recipient. </p> 279 280<li> <p> The local_recipient_maps feature is now turned on by 281default. The Postfix SMTP server uses this to reject mail for 282unknown local recipients. See the LOCAL_RECIPIENT_README file hints 283and tips. </p> 284 285<li> <p> Introduction of the relay delivery transport in master.cf. 286This helps to avoid mail delivery scheduling problems on inbound 287mail relays when there is a lot of outbound mail, but may require 288that you update your "defer_transports" setting. </p> 289 290</ul> 291 292</body> 293 294</html> 295