autoupdate
[postfix-master.git] / postfix-master / basic.html
blob2cdc5c83e14036193df4a71c53674e2808a91faf
1 <html>
3 <head>
5 <title> Postfix Configuration - Basics </title>
7 <META NAME="ROBOTS" CONTENT="NOINDEX,NOFOLLOW">
8 </head>
10 <body background="obsolete.gif">
12 <h1><a href="big-picture.html"><img src="small-picture.gif" width="115" height="45"></a> Postfix Configuration - Basics </h1>
14 <hr>
16 <p> <strong> Note: this web page is no longer maintained. It exists
17 only to avoid breaking links in web pages that describe earlier
18 versions of the Postfix mail system. </strong> </p>
20 <a href="docs.html">Up one level</a> | Basic Configuration | <a
21 href="uce.html">UCE Controls</a> | <a href="rate.html"> Rate
22 Controls</a> | <a href="resource.html"> Resource Controls</a> | <a
23 href="rewrite.html"> Address Manipulation </a>
25 <h2> Introduction </h2>
27 Postfix has several hundred configuration parameters that are controlled
28 via the <b>main.cf</b> file. Fortunately, they have sensible
29 default values. In most cases, you need to configure only two or
30 three parameters before you can use the Postfix mail system:
32 <ul>
34 <li> <a href="#myorigin"> What domain to use in outbound mail </a>
36 <p>
38 <li> <a href="#mydestination"> What domains to receive mail for
39 </a>
40 <p>
42 <li> <a href="#relaying"> What clients to relay mail for </a>
44 </ul>
46 The default values for many other configuration parameters are
47 derived from just these.
49 <p>
51 The next parameter of interest controls the amount of mail sent
52 to the local postmaster:
54 <ul>
56 <li> <a href="#notify"> What trouble to report to the postmaster
57 </a>
59 </ul>
61 <p>
63 Be sure to set the following correctly if you're behind a proxy or
64 network address translator, and you are running a backup MX host
65 for some other domain:
67 <p>
69 <ul>
71 <li> <a href="#proxy_interfaces"> Proxy/NAT network addresses </a>
73 </ul>
75 By the way, if you change parameters of a running Postfix system,
76 don't forget to issue a <b>postfix reload</b> command.
78 <p>
80 If you run Postfix on a virtual network interface, or if your
81 machine runs other mailers on virtual interfaces, you'll have to
82 look at the other parameters listed here as well:
84 <ul>
86 <li> <a href="#myhostname"> My own hostname </a>
88 <p>
90 <li> <a href="#mydomain"> My own domain name </a>
92 <p>
94 <li> <a href="#mynetworks"> My own networks </a>
96 <p>
98 <li> <a href="#inet_interfaces"> My own network addresses </a>
100 </ul>
102 <a name="myorigin"> <h2> What domain to use in outbound mail </h2> </a>
104 The <b>myorigin</b> parameter specifies the domain that appears in
105 mail that is posted on this machine. The default is to use the
106 local machine name, <b><a href="#myhostname"> $myhostname</a>, </b>
107 which defaults to the name of the machine. Unless you are running
108 a really small site, you probably want to change that into <b><a
109 href="#mydomain"> $mydomain</a>,</b> which defaults to the parent
110 domain of the machine name.
114 For the sake of consistency between sender and recipient addresses,
115 <b>myorigin</b> also specifies the default domain name that is
116 appended to an unqualified recipient address.
120 <dl>
122 <dt> Examples:
126 <dd> <b>myorigin = $myhostname</b> (default)
128 <dd> <b>myorigin = $mydomain</b> (probably desirable)
130 </dl>
132 <a name="mydestination"> <h2> What domains to receive mail for
133 </h2> </a>
135 The <b>mydestination</b> parameter specifies what domains this
136 machine will deliver locally, instead of forwarding to another
137 machine. The default is to receive mail for the machine itself.
141 You can specify zero or more domain names, <i>/file/name</i> patterns
142 and/or <i>type:name</i> lookup tables, separated by whitespace
143 and/or commas. A <i>/file/name</i> is replaced by its contents;
144 <i>type:name</i> requests that a table lookup is done.
148 If your machine is a mail server for its entire domain, you must
149 list <b>$mydomain</b> as well.
153 <dl> Examples:
157 <dl>
159 <dt> Default setting:
161 <dd> <b>mydestination = $myhostname localhost.$mydomain</b>
165 <dt> Domain-wide mail server:
167 <dd> <b>mydestination = $myhostname localhost.$mydomain $mydomain
168 </b>
172 <dt> Host with multiple DNS A records:
174 <dd> <b>mydestination = $myhostname localhost.$mydomain www.$mydomain
175 ftp.$mydomain</b>
177 </dl>
181 Caution: in order to avoid mail delivery loops, you must list all
182 hostnames of the machine, including $myhostname, and localhost.$mydomain.
184 </dl>
186 <a name="relaying"> <h2> What clients to relay mail for </h2> </a>
188 By default, Postfix will relay mail for clients in authorized
189 networks.
193 Authorized client networks are defined by the <a
194 href="#mynetworks">mynetworks</a> parameter. The default is to
195 authorize all clients in the IP subnetworks that the local machine
196 is attached to.
198 <a name="notify"> <h2> What trouble to report to the postmaster
199 </h2> </a>
201 You should set up a <b>postmaster</b> <a
202 href="rewrite.html#aliases">alias</a> that points to a human person.
203 This alias is required to exist, so that people can report mail
204 delivery problems.
208 The Postfix system itself also reports problems to the postmaster
209 alias. You may not be interested in all types of trouble reports,
210 so this reporting mechanism is configurable. The default is to
211 report only serious problems (resource, software) to postmaster:
215 <dl>
217 <dt> Default:
219 <dd> <b>notify_classes = resource, software</b>
223 <dt>The meaning of the classes is as follows:
227 <dl>
229 <dt> <b>bounce</b> <dd> Send postmaster copies of undeliverable
230 mail. If mail is undeliverable, a so-called single bounce message
231 is sent, with a copy of the message that was not delivered. For
232 privacy reasons, the postmaster copy of a single bounce message is
233 truncated after the original message headers. If a single bounce
234 message is undeliverable, the postmaster receives a double bounce
235 message with a copy of the entire single bounce message. See also
236 the <a href="rewrite.html#luser_relay"> luser_relay</a> feature.
240 <dt> <b>2bounce</b> <dd> Send double bounces to the postmaster.
244 <dt> <b>delay</b> <dd> Inform the postmaster of delayed mail.
245 In this case, the postmaster receives message headers only.
249 <dt> <b>policy</b> <dd> Inform the postmaster of client requests
250 that were rejected because of (UCE) policy restrictions. The
251 postmaster receives a transcript of the entire SMTP session.
255 <dt> <b>protocol</b> <dd> Inform the postmaster of protocol errors
256 (client or server side) or attempts by a client to execute
257 unimplemented commands. The postmaster receives a transcript of
258 the entire SMTP session.
262 <dt> <b>resource</b> <dd> Inform the postmaster of mail not delivered
263 due to resource problems (for example, queue file write errors).
267 <dt> <b>software</b> <dd> Inform the postmaster of mail not delivered
268 due to software problems.
270 </dl>
272 </dl>
274 <a name="proxy_interfaces"> <h2> Proxy/NAT network addresses </h2> </a>
276 The <b>proxy_interfaces</b> parameter specifies all network addresses
277 that the Postfix receives mail on by way of a proxy or network
278 address translation unit. You may specify symbolic hostnames instead
279 of network addresses.
283 You must specify your proxy/NAT addresses when your system is a
284 backup MX host for other domains, otherwise mail delivery loops
285 will happen when the primary MX host is down.
289 <dl>
291 <dt> Examples:
295 <dl>
297 <dt> Default:
299 <dd> <b>proxy_interfaces = </b>
303 <dt> Host running backup MTA:
305 <dd> <b>proxy_interfaces = 1.2.3.4</b> (the proxy/NAT network address)
307 </dl>
309 </dl>
311 <a name="myhostname"> <h2> My own hostname </h2> </a>
313 The <b>myhostname</b> parameter describes the fully-qualified domain
314 name of the machine running the Postfix system. <b> $myhostname</b>
315 appears as the default value in many other Postfix configuration
316 parameters.
320 By default, <b>myhostname</b> is set to the local machine name.
321 If your machine name is not in fully-qualified domain name form,
322 or if you run Postfix on a virtual interface, you will have to
323 specify the fully-qualified domain name that the mail system
324 should use.
326 <dl>
328 <dt> Examples:
332 <dd> <b>myhostname = host.local.domain</b> (local hostname is not
333 FQDN)
335 <dd> <b>myhostname = host.virtual.domain</b> (virtual interface)
337 <dd> <b>myhostname = virtual.domain</b> (virtual interface)
339 </dl>
341 <a name="mydomain"> <h2> My own domain name </h2> </a>
343 The <b>mydomain</b> parameter specifies the parent domain of
344 <b>$myhostname.</b> By default it is derived from <b> $myhostname</b>
345 by stripping off the first part (unless the result would be a
346 top-level domain).
348 <dl>
350 <dt> Examples:
354 <dd> <b>mydomain = local.domain</b>
356 <dd> <b>mydomain = virtual.domain</b> (virtual interface)
358 </dl>
360 <a name="mynetworks"> <h2> My own networks </h2> </a>
362 The <b>mynetworks</b> parameter lists all networks that this machine
363 somehow trusts. This information can be used by the <a
364 href="uce.html#smtpd_recipient_restrictions"> anti-UCE</a> features
365 to recognize trusted SMTP clients that are allowed to relay mail
366 through Postfix.
370 You can specify the list of trusted networks in the <b>main.cf</b>
371 file, or you can let Postfix deduce the list for you. The default
372 is to let Postfix do the work for you.
376 <dl>
378 <dt> Default:
380 <dd> <b>mynetworks_style = subnet</b>
384 <dt>The meaning of the styles is as follows:
388 <dl>
390 <dt> <b>class</b> <dd> Trust SMTP clients in the class A/B/C networks
391 that Postfix is connected to. <b>Don't do this with a dialup site
392 - it would cause Postfix to "trust" your entire provider's network.
393 Instead, specify an explicit mynetworks list by hand, as described
394 below</b>.
398 <dt> <b>subnet</b> (default) <dd> Trust SMTP clients in the IP
399 subnetworks that Postfix is connected to.
403 <dt> <b>host</b> <dd> Trust only the local machine.
405 </dl>
407 </dl>
411 Alternatively, you can specify the <b>mynetworks</b> list by hand,
412 in which case Postfix ignores the <b>mynetworks_style</b> setting.
413 To specify the list of trusted networks by hand, specify network
414 blocks in CIDR (network/mask) notation, for example:
418 <dl>
420 <dd> <b>mynetworks = 168.100.189.0/28, 127.0.0.0/8</b>
422 </dl>
426 You can also specify the absolute pathname of a pattern file instead
427 of listing the patterns in the <b>main.cf</b> file.
429 <a name="inet_interfaces"> <h2> My own network addresses </h2> </a>
431 The <b>inet_interfaces</b> parameter specifies all network interface
432 addresses that the Postfix system should listen on; mail addressed
433 to <i>user</i>@[<i>network address</i>] will be delivered locally,
434 as if it is addressed to a domain listed in <b> $mydestination.
435 </b>
439 The default is to listen on all active interfaces. If you run
440 mailers on virtual interfaces, you will have to specify what
441 interfaces to listen on.
445 You even have to specify explicit machine interfaces for the
446 non-virtual mailer that receives mail for the machine itself: the
447 non-virtual mailer should never listen on the virtual interfaces
448 or you would have a mailer loop.
450 <dl>
452 <dt> Examples:
456 <dl>
458 <dt> Default:
460 <dd> <b>inet_interfaces = all</b>
464 <dt> Host running virtual mailers:
466 <dd> <b>inet_interfaces = virtual.host.tld</b> (virtual domain)
468 <dd> <b>inet_interfaces = $myhostname localhost.$mydomain</b>
469 (non-virtual mailer)
471 </dl>
473 </dl>
477 <b>Note: you need to stop and start Postfix when this parameter changes.</b>
479 <hr>
481 <a href="docs.html">Up one level</a> | Basic Configuration | <a
482 href="uce.html">UCE Controls</a> | <a href="rate.html"> Rate
483 Controls</a> | <a href="resource.html"> Resource Controls</a> | <a
484 href="rewrite.html"> Address Manipulation </a>
486 </body>
488 </html>