1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
8 <title>Postfix Address Classes
</title>
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
16 <h1><img src=
"postfix-logo.jpg" width=
"203" height=
"98" ALT=
"">Postfix Address Classes
</h1>
22 <p> Postfix version
2.0 introduces the concept of address classes.
23 This is a way of grouping recipient addresses by their delivery
24 method. The idea comes from discussions with Victor Duchovni.
25 Although address classes introduced a few incompatibilities they
26 also made it possible to improve the handling of hosted domains
27 and of unknown recipients.
</p>
29 <p> This document provides information on the following topics:
</p>
33 <li><a href=
"#wtf">What are address classes good for?
</a>
35 <li><a href=
"#classes">What address classes does Postfix implement?
</a>
37 <li><a href=
"#improvements">Improvements compared to Postfix
1.1</a>
39 <li><a href=
"#incompatibility">Incompatibilities with Postfix
1.1</a>
43 <h2><a name=
"wtf">What are address classes good for?
</a></h2>
45 <p> Why should you care about address classes? This is how Postfix
46 decides what mail to accept, and how to deliver it. In other words,
47 address classes are very important for the operation of Postfix.
</p>
49 <p> An address class is defined by three items.
</p>
53 <li> <p> The list of domains that are a member of the class: for
54 example, all local domains, or all relay domains.
</p>
56 <li> <p> The default delivery transport. For example, the local,
57 virtual or relay delivery transport (delivery transports are defined
58 in master.cf). This helps to keep Postfix configurations simple,
59 by avoiding the need for explicit routing information in transport
62 <li> <p> The list of valid recipient addresses for that address
63 class. The Postfix SMTP server rejects invalid recipients with
64 "User unknown in <name of address class here> table". This
65 helps to keep the Postfix queue free of undeliverable MAILER-DAEMON
70 <h2><a name=
"classes">What address classes does Postfix implement?
</a></h2>
72 <p> Initially the list of address classes is hard coded, but this
73 is meant to become extensible. The summary below describes the main
74 purpose of each class, and what the relevant configuration parameters
77 <p> The
<a name=
"local_domain_class">local
</a> domain class.
</p>
81 <li> <p> Purpose: final delivery for traditional UNIX system accounts
82 and traditional Sendmail-style aliases. This is typically used for
83 the canonical domains of the machine. For a discussion of the
84 difference between canonical domains, hosted domains and other
85 domains, see the VIRTUAL_README file.
</p>
87 <li> <p> Domain names are listed with the mydestination parameter.
88 This domain class also includes mail for
<i>user@[ipaddress]
</i>
89 when the IP address is listed with the inet_interfaces or
90 proxy_interfaces parameters.
</p>
92 <li> <p> Valid recipient addresses are listed with the local_recipient_maps
93 parameter, as described in LOCAL_RECIPIENT_README. The Postfix SMTP
94 server rejects invalid recipients with
"User unknown in local
95 recipient table". If the local_recipient_maps parameter value is
96 empty, then the Postfix SMTP server accepts any address in the
97 local domain class.
</p>
99 <li> <p> The mail delivery transport is specified with the
100 local_transport parameter. The default value is
<b>local:$myhostname
</b>
101 for delivery with the local(
8) delivery agent.
</p>
105 <p> The
<a name=
"virtual_alias_class">virtual alias
</a> domain
110 <li> <p> Purpose: hosted domains where each recipient address is
111 aliased to a local UNIX system account or to a remote address. A
112 virtual alias example is given in the VIRTUAL_README file.
</p>
114 <li> <p> Domain names are listed in virtual_alias_domains. The
115 default value is $virtual_alias_maps for Postfix
1.1 compatibility.
118 <li> <p> Valid recipient addresses are listed with the virtual_alias_maps
119 parameter. The Postfix SMTP server rejects invalid recipients with
120 "User unknown in virtual alias table". The default value is
121 $virtual_maps for Postfix
1.1 compatibility.
</p>
123 <li> <p> There is no mail delivery transport parameter. Every
124 address must be aliased to some other address.
</p>
128 <p> The
<a name=
"virtual_mailbox_class">virtual mailbox
</a> domain
133 <li> <p> Purpose: final delivery for hosted domains where each
134 recipient address can have its own mailbox, and where users do not
135 need to have a UNIX system account. A virtual mailbox example is
136 given in the VIRTUAL_README file.
</p>
138 <li> <p> Domain names are listed with the virtual_mailbox_domains
139 parameter. The default value is $virtual_mailbox_maps for Postfix
140 1.1 compatibility.
</p>
142 <li> <p> Valid recipient addresses are listed with the virtual_mailbox_maps
143 parameter. The Postfix SMTP server rejects invalid recipients with
144 "User unknown in virtual mailbox table". If this parameter value
145 is empty, the Postfix SMTP server accepts all recipients for domains
146 listed in $virtual_mailbox_domains.
</p>
148 <li> <p> The mail delivery transport is specified with the
149 virtual_transport parameter. The default value is
<b>virtual
</b>
150 for delivery with the virtual(
8) delivery agent.
</p>
154 <p> The
<a name=
"relay_domain_class">relay
</a> domain class.
</p>
158 <li> <p> Purpose: mail forwarding to remote destinations that list
159 your system as primary or backup MX host. For a discussion of the
160 basic configuration details, see the BASIC_CONFIGURATION_README
161 document. For a discussion of the difference between canonical
162 domains, hosted domains and other domains, see the VIRTUAL_README
165 <li> <p> Domain names are listed with the relay_domains parameter.
168 <li> <p> Valid recipient addresses are listed with the relay_recipient_maps
169 parameter. The Postfix SMTP server rejects invalid recipients with
170 "User unknown in relay recipient table". If this parameter value
171 is empty, the Postfix SMTP server accepts all recipients for domains
172 listed with the relay_domains parameter.
</p>
174 <li> <p> The mail delivery transport is specified with the
175 relay_transport parameter. The default value is
<b>relay
</b> which
176 is a clone of the smtp(
8) delivery agent.
</p>
180 <p> The
<a name=
"default_domain_class">default
</a> domain class.
185 <li> <p> Purpose: mail forwarding to the Internet on behalf of
186 authorized clients. For a discussion of the basic configuration
187 details, see the BASIC_CONFIGURATION_README file. For a discussion
188 of the difference between canonical domains, hosted domains and
189 other domains, see the VIRTUAL_README file.
</p>
191 <li> <p> This class has no destination domain table.
</p>
193 <li> <p> This class has no valid recipient address table.
</p>
195 <li> <p> The mail delivery transport is specified with the
196 default_transport parameter. The default value is
<b>smtp
</b> for
197 delivery with the smtp(
8) delivery agent.
</p>
201 <h2><a name=
"improvements">Improvements compared to Postfix
204 <p> Postfix
2.0 address classes made the following improvements
205 possible over earlier Postfix versions:
</p>
209 <li> <p> You no longer need to specify all the virtual(
8) mailbox
210 domains in the Postfix transport map. The virtual(
8) delivery agent
211 has become a first-class citizen just like local(
8) or smtp(
8).
214 <li> <p> On mail gateway systems, address classes provide separation
215 of inbound mail relay traffic ($relay_transport) from outbound
216 traffic ($default_transport). This eliminates a problem where
217 inbound mail deliveries could become resource starved in the presence
218 of a high volume of outbound mail.
</p>
220 <li> <p> The SMTP server rejects unknown recipients in a more
221 consistent manner than was possible with Postfix version
1. This
222 is needed to keep undeliverable mail (and bounced undeliverable
223 mail) out of the mail queue. This is controlled by the
224 smtpd_reject_unlisted_recipient configuration parameter.
</p>
226 <li> <p> As of Postfix version
2.1, the SMTP server also rejects
227 unknown sender addresses (i.e. addresses that it would reject as
228 unknown recipient addresses). Sender
"egress filtering" can help
229 to slow down an email worm explosion. This is controlled by the
230 smtpd_reject_unlisted_sender configuration parameter.
</p>
234 <h2><a name=
"incompatibility">Incompatibilities with Postfix
1.1</a></h2>
236 <p> Postfix
2.0 address classes introduce a few incompatible changes
237 in documented behavior. In order to ease the transitions, new
238 parameters have default values that are backwards compatible.
</p>
242 <li> <p> The virtual_maps parameter is replaced by virtual_alias_maps
243 (for address lookups) and by virtual_alias_domains (for the names
244 of what were formerly called
"Postfix-style virtual domains").
</p>
246 <p> For backwards compatibility with Postfix version
1.1, the new
247 virtual_alias_maps parameter defaults to $virtual_maps, and the
248 new virtual_alias_domains parameter defaults to $virtual_alias_maps.
251 <li> <p> The virtual_mailbox_maps parameter now has a companion
252 parameter called virtual_mailbox_domains (for the names of domains
253 served by the virtual delivery agent). The virtual_mailbox_maps
254 parameter is now used for address lookups only.
</p>
256 <p> For backwards compatibility with Postfix version
1.1, the new
257 virtual_mailbox_domains parameter defaults to $virtual_mailbox_maps.
260 <li> <p> Introduction of the relay_recipient_maps parameter. The
261 Postfix SMTP server can use this to block mail for relay recipients
262 that don't exist. This list is empty by default, which means accept
265 <li> <p> The local_recipient_maps feature is now turned on by
266 default. The Postfix SMTP server uses this to reject mail for
267 unknown local recipients. See the LOCAL_RECIPIENT_README file hints
270 <li> <p> Introduction of the relay delivery transport in master.cf.
271 This helps to avoid mail delivery scheduling problems on inbound
272 mail relays when there is a lot of outbound mail, but may require
273 that you update your
"defer_transports" setting.
</p>