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