1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
|
<html>
<head>
<title> Postfix Configuration - Basics </title>
</head>
<body>
<h1><a href="big-picture.html"><img src="small-picture.gif" width="115" height="45"></a> Postfix Configuration - Basics </h1>
<hr>
<a href="index.html">Up one level</a> | Basic Configuration | <a
href="uce.html">UCE Controls</a> | <a href="rate.html"> Rate
Controls</a> | <a href="resource.html"> Resource Controls</a> | <a
href="rewrite.html"> Address Manipulation </a>
<h2> Introduction </h2>
Postfix has several hundred configuration parameters that are controlled
via the <b>main.cf</b> file. Fortunately, they have sensible
default values. In most cases, you need to configure only two or
three parameters before you can use the Postfix mail system:
<ul>
<li> <a href="#myorigin"> What domain to use in outbound mail </a>
<p>
<li> <a href="#mydestination"> What domains to receive mail for
</a>
<p>
<li> <a href="#relaying"> What clients to relay mail for </a>
</ul>
The default values for many other configuration parameters are
derived from just these.
<p>
The next parameter of interest controls the amount of mail sent
to the local postmaster:
<ul>
<li> <a href="#notify"> What trouble to report to the postmaster
</a>
</ul>
<p>
Be sure to set the following correctly if you're behind a proxy or
network address translator, and you are running a backup MX host
for some other domain:
<p>
<ul>
<li> <a href="#proxy_interfaces"> Proxy/NAT network addresses </a>
</ul>
By the way, if you change parameters of a running Postfix system,
don't forget to issue a <b>postfix reload</b> command.
<p>
If you run Postfix on a virtual network interface, or if your
machine runs other mailers on virtual interfaces, you'll have to
look at the other parameters listed here as well:
<ul>
<li> <a href="#myhostname"> My own hostname </a>
<p>
<li> <a href="#mydomain"> My own domain name </a>
<p>
<li> <a href="#mynetworks"> My own networks </a>
<p>
<li> <a href="#inet_interfaces"> My own network addresses </a>
</ul>
<a name="myorigin"> <h2> What domain to use in outbound mail </h2> </a>
The <b>myorigin</b> parameter specifies the domain that appears in
mail that is posted on this machine. The default is to use the
local machine name, <b><a href="#myhostname"> $myhostname</a>, </b>
which defaults to the name of the machine. Unless you are running
a really small site, you probably want to change that into <b><a
href="#mydomain"> $mydomain</a>,</b> which defaults to the parent
domain of the machine name.
<p>
For the sake of consistency between sender and recipient addresses,
<b>myorigin</b> also specifies the default domain name that is
appended to an unqualified recipient address.
<p>
<dl>
<dt> Examples:
<p>
<dd> <b>myorigin = $myhostname</b> (default)
<dd> <b>myorigin = $mydomain</b> (probably desirable)
</dl>
<a name="mydestination"> <h2> What domains to receive mail for
</h2> </a>
The <b>mydestination</b> parameter specifies what domains this
machine will deliver locally, instead of forwarding to another
machine. The default is to receive mail for the machine itself.
<p>
You can specify zero or more domain names, <i>/file/name</i> patterns
and/or <i>type:name</i> lookup tables, separated by whitespace
and/or commas. A <i>/file/name</i> is replaced by its contents;
<i>type:name</i> requests that a table lookup is done.
<p>
If your machine is a mail server for its entire domain, you must
list <b>$mydomain</b> as well.
<p>
<dl> Examples:
<p>
<dl>
<dt> Default setting:
<dd> <b>mydestination = $myhostname localhost.$mydomain</b>
<p>
<dt> Domain-wide mail server:
<dd> <b>mydestination = $myhostname localhost.$mydomain $mydomain
</b>
<p>
<dt> Host with multiple DNS A records:
<dd> <b>mydestination = $myhostname localhost.$mydomain www.$mydomain
ftp.$mydomain</b>
</dl>
<p>
Caution: in order to avoid mail delivery loops, you must list all
hostnames of the machine, including $myhostname, and localhost.$mydomain.
</dl>
<a name="relaying"> <h2> What clients to relay mail for </h2> </a>
By default, Postfix will relay mail for clients in authorized
networks.
<p>
Authorized client networks are defined by the <a
href="#mynetworks">mynetworks</a> parameter. The default is to
authorize all clients in the IP subnetworks that the local machine
is attached to.
<a name="notify"> <h2> What trouble to report to the postmaster
</h2> </a>
You should set up a <b>postmaster</b> <a
href="rewrite.html#aliases">alias</a> that points to a human person.
This alias is required to exist, so that people can report mail
delivery problems.
<p>
The Postfix system itself also reports problems to the postmaster
alias. You may not be interested in all types of trouble reports,
so this reporting mechanism is configurable. The default is to
report only serious problems (resource, software) to postmaster:
<p>
<dl>
<dt> Default:
<dd> <b>notify_classes = resource, software</b>
<p>
<dt>The meaning of the classes is as follows:
<p>
<dl>
<dt> <b>bounce</b> <dd> Send postmaster copies of undeliverable
mail. If mail is undeliverable, a so-called single bounce message
is sent, with a copy of the message that was not delivered. For
privacy reasons, the postmaster copy of a single bounce message is
truncated after the original message headers. If a single bounce
message is undeliverable, the postmaster receives a double bounce
message with a copy of the entire single bounce message. See also
the <a href="rewrite.html#luser_relay"> luser_relay</a> feature.
<p>
<dt> <b>2bounce</b> <dd> Send double bounces to the postmaster.
<p>
<dt> <b>delay</b> <dd> Inform the postmaster of delayed mail.
In this case, the postmaster receives message headers only.
<p>
<dt> <b>policy</b> <dd> Inform the postmaster of client requests
that were rejected because of (UCE) policy restrictions. The
postmaster receives a transcript of the entire SMTP session.
<p>
<dt> <b>protocol</b> <dd> Inform the postmaster of protocol errors
(client or server side) or attempts by a client to execute
unimplemented commands. The postmaster receives a transcript of
the entire SMTP session.
<p>
<dt> <b>resource</b> <dd> Inform the postmaster of mail not delivered
due to resource problems (for example, queue file write errors).
<p>
<dt> <b>software</b> <dd> Inform the postmaster of mail not delivered
due to software problems.
</dl>
</dl>
<a name="proxy_interfaces"> <h2> Proxy/NAT network addresses </h2> </a>
The <b>proxy_interfaces</b> parameter specifies all network addresses
that the Postfix receives mail on by way of a proxy or network
address translation unit. You may specify symbolic hostnames instead
of network addresses.
<p>
You must specify your proxy/NAT addresses when your system is a
backup MX host for other domains, otherwise mail delivery loops
will happen when the primary MX host is down.
<p>
<dl>
<dt> Examples:
<p>
<dl>
<dt> Default:
<dd> <b>proxy_interfaces = </b>
<p>
<dt> Host running backup MTA:
<dd> <b>proxy_interfaces = 1.2.3.4</b> (the proxy/NAT network address)
</dl>
</dl>
<a name="myhostname"> <h2> My own hostname </h2> </a>
The <b>myhostname</b> parameter describes the fully-qualified domain
name of the machine running the Postfix system. <b> $myhostname</b>
appears as the default value in many other Postfix configuration
parameters.
<p>
By default, <b>myhostname</b> is set to the local machine name.
If your machine name is not in fully-qualified domain name form,
or if you run Postfix on a virtual interface, you will have to
specify the fully-qualified domain name that the mail system
should use.
<dl>
<dt> Examples:
<p>
<dd> <b>myhostname = host.local.domain</b> (local hostname is not
FQDN)
<dd> <b>myhostname = host.virtual.domain</b> (virtual interface)
<dd> <b>myhostname = virtual.domain</b> (virtual interface)
</dl>
<a name="mydomain"> <h2> My own domain name </h2> </a>
The <b>mydomain</b> parameter specifies the parent domain of
<b>$myhostname.</b> By default it is derived from <b> $myhostname</b>
by stripping off the first part (unless the result would be a
top-level domain).
<dl>
<dt> Examples:
<p>
<dd> <b>mydomain = local.domain</b>
<dd> <b>mydomain = virtual.domain</b> (virtual interface)
</dl>
<a name="mynetworks"> <h2> My own networks </h2> </a>
The <b>mynetworks</b> parameter lists all networks that this machine
somehow trusts. This information can be used by the <a href="uce.html">
anti-UCE</a> features to recognize trusted SMTP clients that are
allowed to relay mail through Postfix.
<p>
You can specify the list of trusted networks in the <b>main.cf</b>
file, or you can let Postfix deduce the list for you. The default
is to let Postfix do the work for you.
<p>
<dl>
<dt> Default:
<dd> <b>mynetworks_style = subnet</b>
<p>
<dt>The meaning of the styles is as follows:
<p>
<dl>
<dt> <b>class</b> <dd> Trust SMTP clients in the class A/B/C networks
that Postfix is connected to. <b>Don't do this with a dialup site
- it would cause Postfix to "trust" your entire provider's network.
Instead, specify an explicit mynetworks list by hand, as described
below</b>.
<p>
<dt> <b>subnet</b> (default) <dd> Trust SMTP clients in the IP
subnetworks that Postfix is connected to.
<p>
<dt> <b>host</b> <dd> Trust only the local machine.
</dl>
</dl>
<p>
Alternatively, you can specify the <b>mynetworks</b> list by hand,
in which case Postfix ignores the <b>mynetworks_style</b> setting.
To specify the list of trusted networks by hand, specify network
blocks in CIDR (network/mask) notation, for example:
<p>
<dl>
<dd> <b>mynetworks = 168.100.189.0/28, 127.0.0.0/8</b>
</dl>
<p>
You can also specify the absolute pathname of a pattern file instead
of listing the patterns in the <b>main.cf</b> file.
<a name="inet_interfaces"> <h2> My own network addresses </h2> </a>
The <b>inet_interfaces</b> parameter specifies all network interface
addresses that the Postfix system should listen on; mail addressed
to <i>user</i>@[<i>network address</i>] will be delivered locally,
as if it is addressed to a domain listed in <b> $mydestination.
</b>
<p>
The default is to listen on all active interfaces. If you run
mailers on virtual interfaces, you will have to specify what
interfaces to listen on.
<p>
You even have to specify explicit machine interfaces for the
non-virtual mailer that receives mail for the machine itself: the
non-virtual mailer should never listen on the virtual interfaces
or you would have a mailer loop.
<dl>
<dt> Examples:
<p>
<dl>
<dt> Default:
<dd> <b>inet_interfaces = all</b>
<p>
<dt> Host running virtual mailers:
<dd> <b>inet_interfaces = virtual.host.tld</b> (virtual domain)
<dd> <b>inet_interfaces = $myhostname localhost.$mydomain</b>
(non-virtual mailer)
</dl>
</dl>
<p>
<b>Note: you need to stop and start Postfix when this parameter changes.</b>
<hr>
<a href="index.html">Up one level</a> | Basic Configuration | <a
href="uce.html">UCE Controls</a> | <a href="rate.html"> Rate
Controls</a> | <a href="resource.html"> Resource Controls</a> | <a
href="rewrite.html"> Address Manipulation </a>
</body>
</html>
|