~ubuntu-branches/ubuntu/maverick/postfix/maverick-security

« back to all changes in this revision

Viewing changes to html/BASIC_CONFIGURATION_README.html

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, Wietse Venema, LaMont Jones
  • Date: 2009-06-03 14:17:08 UTC
  • mfrom: (1.1.22 upstream)
  • Revision ID: james.westby@ubuntu.com-20090603141708-o9u59xlor7nmd2x1
[Wietse Venema]

* New upstream release: 2.6.2~rc1

[LaMont Jones]

* move postfix-add-{filter,policy} manpages to section 8, and deliver
* provide: default-mta on ubuntu

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
<h2> Introduction </h2>
21
21
 
22
22
<p> Postfix has several hundred configuration parameters that are
23
 
controlled via the main.cf file.  Fortunately, all parameters have
 
23
controlled via the <a href="postconf.5.html">main.cf</a> file.  Fortunately, all parameters have
24
24
sensible default values.  In many cases, you need to configure only
25
25
two or three parameters before you can start to play with the mail
26
26
system. Here's a quick introduction to the syntax:  </p>
121
121
<h2> <a name="syntax">Postfix configuration files</a></h2>
122
122
 
123
123
<p> By default, Postfix configuration files are in /etc/postfix.
124
 
The two most important files are main.cf and master.cf; these files
 
124
The two most important files are <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a>; these files
125
125
must be owned by root.  Giving someone else write permission to
126
 
main.cf or master.cf (or to their parent directories) means giving
 
126
<a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a> (or to their parent directories) means giving
127
127
root privileges to that person. </p>
128
128
 
129
 
<p> In /etc/postfix/main.cf you will have to set up a minimal number
 
129
<p> In /etc/postfix/<a href="postconf.5.html">main.cf</a> you will have to set up a minimal number
130
130
of configuration parameters.  Postfix configuration parameters
131
131
resemble shell variables, with two important differences: the first
132
132
one is that Postfix does not know about quotes like the UNIX shell
136
136
 
137
137
<blockquote>
138
138
<pre>
139
 
/etc/postfix/main.cf:
 
139
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
140
140
    parameter = value
141
141
</pre>
142
142
</blockquote>
145
145
 
146
146
<blockquote>
147
147
<pre>
148
 
/etc/postfix/main.cf:
 
148
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
149
149
    other_parameter = $parameter
150
150
</pre>
151
151
</blockquote>
162
162
 
163
163
<blockquote>
164
164
<pre>
165
 
/etc/postfix/main.cf:
 
165
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
166
166
    <a href="postconf.5.html#virtual_alias_maps">virtual_alias_maps</a> = hash:/etc/postfix/virtual
167
167
</pre>
168
168
</blockquote>
169
169
 
170
 
<p> Whenever you make a change to the main.cf or master.cf file,
 
170
<p> Whenever you make a change to the <a href="postconf.5.html">main.cf</a> or <a href="master.5.html">master.cf</a> file,
171
171
execute the following command as root in order to refresh a running
172
172
mail system: </p>
173
173
 
194
194
 
195
195
<blockquote>
196
196
<pre>
197
 
/etc/postfix/main.cf:
 
197
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
198
198
    <a href="postconf.5.html#myorigin">myorigin</a> = $<a href="postconf.5.html#myhostname">myhostname</a> (default: send mail as "user@$<a href="postconf.5.html#myhostname">myhostname</a>")
199
199
    <a href="postconf.5.html#myorigin">myorigin</a> = $<a href="postconf.5.html#mydomain">mydomain</a>   (probably desirable: "user@$<a href="postconf.5.html#mydomain">mydomain</a>")
200
200
</pre>
223
223
 
224
224
<blockquote>
225
225
<pre>
226
 
/etc/postfix/main.cf:
 
226
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
227
227
    <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a> localhost.$<a href="postconf.5.html#mydomain">mydomain</a> localhost
228
228
</pre>
229
229
</blockquote>
232
232
 
233
233
<blockquote>
234
234
<pre>
235
 
/etc/postfix/main.cf:
 
235
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
236
236
    <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a> localhost.$<a href="postconf.5.html#mydomain">mydomain</a> localhost $<a href="postconf.5.html#mydomain">mydomain</a>
237
237
</pre>
238
238
</blockquote>
241
241
 
242
242
<blockquote>
243
243
<pre>
244
 
/etc/postfix/main.cf:
 
244
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
245
245
    <a href="postconf.5.html#mydestination">mydestination</a> = $<a href="postconf.5.html#myhostname">myhostname</a> localhost.$<a href="postconf.5.html#mydomain">mydomain</a> localhost 
246
246
        www.$<a href="postconf.5.html#mydomain">mydomain</a> ftp.$<a href="postconf.5.html#mydomain">mydomain</a>
247
247
</pre>
265
265
 
266
266
<blockquote>
267
267
<pre>
268
 
/etc/postfix/main.cf:
 
268
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
269
269
    <a href="postconf.5.html#mynetworks_style">mynetworks_style</a> = subnet  (default: authorize subnetworks)
270
270
    <a href="postconf.5.html#mynetworks_style">mynetworks_style</a> = host    (safe: authorize local machine only)
271
271
    <a href="postconf.5.html#mynetworks">mynetworks</a> = 127.0.0.0/8   (safe: authorize local machine only)
273
273
</pre>
274
274
</blockquote>
275
275
 
276
 
<p> You can specify the trusted networks in the main.cf file, or
 
276
<p> You can specify the trusted networks in the <a href="postconf.5.html">main.cf</a> file, or
277
277
you can let Postfix do the work for you. The default is to let
278
278
Postfix do the work. The result depends on the <a href="postconf.5.html#mynetworks_style">mynetworks_style</a>
279
279
parameter value.
304
304
 
305
305
<blockquote>
306
306
<pre>
307
 
/etc/postfix/main.cf:
 
307
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
308
308
    <a href="postconf.5.html#mynetworks">mynetworks</a> = 168.100.189.0/28, 127.0.0.0/8
309
309
</pre>
310
310
</blockquote>
311
311
 
312
312
<p> You can also specify the absolute pathname of a pattern file instead
313
 
of listing the patterns in the main.cf file. </p>
 
313
of listing the patterns in the <a href="postconf.5.html">main.cf</a> file. </p>
314
314
 
315
315
<h2> <a name="relay_to"> What destinations to relay mail to </a> </h2>
316
316
 
325
325
 
326
326
<blockquote>
327
327
<pre>
328
 
/etc/postfix/main.cf:
 
328
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
329
329
    <a href="postconf.5.html#relay_domains">relay_domains</a> = $<a href="postconf.5.html#mydestination">mydestination</a> (default)
330
330
    <a href="postconf.5.html#relay_domains">relay_domains</a> =           (safe: never forward mail from strangers)
331
331
    <a href="postconf.5.html#relay_domains">relay_domains</a> = $<a href="postconf.5.html#mydomain">mydomain</a> (forward mail to my domain and subdomains)
341
341
office hours, it may be behind a firewall, or it may be connected
342
342
via a provider who does not allow direct mail to the Internet.  In
343
343
those cases you need to configure Postfix to deliver mail indirectly
344
 
via a relay host. </p>
 
344
via a <a href="postconf.5.html#relayhost">relay host</a>. </p>
345
345
 
346
346
<p> Examples (specify only one of the following): </p>
347
347
 
348
348
<blockquote>
349
349
<pre>
350
 
/etc/postfix/main.cf:
 
350
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
351
351
    <a href="postconf.5.html#relayhost">relayhost</a> =                   (default: direct delivery to Internet)
352
352
    <a href="postconf.5.html#relayhost">relayhost</a> = $<a href="postconf.5.html#mydomain">mydomain</a>         (deliver via local mailhub)
353
353
    <a href="postconf.5.html#relayhost">relayhost</a> = [mail.$<a href="postconf.5.html#mydomain">mydomain</a>]  (deliver via local mailhub)
392
392
 
393
393
<blockquote>
394
394
<pre>
395
 
/etc/postfix/main.cf:
 
395
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
396
396
    <a href="postconf.5.html#notify_classes">notify_classes</a> = resource, software
397
397
</pre>
398
398
</blockquote>
477
477
 
478
478
<blockquote>
479
479
<pre>
480
 
/etc/postfix/main.cf:
 
480
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
481
481
    <a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> = 1.2.3.4 (the proxy/NAT external network address)
482
482
</pre>
483
483
</blockquote>
539
539
<h2> <a name="chroot_setup"> Running Postfix daemon processes
540
540
chrooted </a> </h2>
541
541
 
542
 
<p> Postfix daemon processes can be configured (via the master.cf
 
542
<p> Postfix daemon processes can be configured (via the <a href="master.5.html">master.cf</a>
543
543
file) to run in a chroot jail.  The processes run at a fixed low
544
544
privilege and with file system access limited to the Postfix queue
545
545
directories (/var/spool/postfix).  This provides a significant
556
556
porcupine.org mail server runs all daemons chrooted that can be
557
557
chrooted.  </p>
558
558
 
559
 
<p>The default /etc/postfix/master.cf file specifies that no Postfix
 
559
<p>The default /etc/postfix/<a href="master.5.html">master.cf</a> file specifies that no Postfix
560
560
daemon runs chrooted. In order to enable chroot operation, edit
561
 
the file /etc/postfix/master.cf, and follow instructions in the
 
561
the file /etc/postfix/<a href="master.5.html">master.cf</a>, and follow instructions in the
562
562
file.  When you're finished, execute "postfix reload" to make the
563
563
change effective. </p>
564
564
 
592
592
specify the fully-qualified domain name that the mail system should
593
593
use. </p>
594
594
 
595
 
<p> Alternatively, if you specify <a href="postconf.5.html#mydomain">mydomain</a> in main.cf, then Postfix
 
595
<p> Alternatively, if you specify <a href="postconf.5.html#mydomain">mydomain</a> in <a href="postconf.5.html">main.cf</a>, then Postfix
596
596
will use its value to generate a fully-qualified default value      
597
597
for the <a href="postconf.5.html#myhostname">myhostname</a> parameter. </p>
598
598
 
600
600
 
601
601
<blockquote>
602
602
<pre>
603
 
/etc/postfix/main.cf:
 
603
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
604
604
    <a href="postconf.5.html#myhostname">myhostname</a> = host.local.domain (machine name is not FQDN)
605
605
    <a href="postconf.5.html#myhostname">myhostname</a> = host.virtual.domain (virtual interface)
606
606
    <a href="postconf.5.html#myhostname">myhostname</a> = virtual.domain (virtual interface)
614
614
by stripping off the first part (unless the result would be a
615
615
top-level domain). </p>
616
616
 
617
 
<p> Conversely, if you specify <a href="postconf.5.html#mydomain">mydomain</a> in main.cf, then Postfix
 
617
<p> Conversely, if you specify <a href="postconf.5.html#mydomain">mydomain</a> in <a href="postconf.5.html">main.cf</a>, then Postfix
618
618
will use its value to generate a fully-qualified default value
619
619
for the <a href="postconf.5.html#myhostname">myhostname</a> parameter. </p>
620
620
 
622
622
 
623
623
<blockquote>
624
624
<pre>
625
 
/etc/postfix/main.cf:
 
625
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
626
626
    <a href="postconf.5.html#mydomain">mydomain</a> = local.domain
627
627
    <a href="postconf.5.html#mydomain">mydomain</a> = virtual.domain (virtual interface)
628
628
</pre> 
636
636
as if it is addressed to a domain listed in  $<a href="postconf.5.html#mydestination">mydestination</a>.</p>
637
637
 
638
638
<p> You can override the <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> setting in the Postfix
639
 
master.cf file by prepending an IP address to a server name. </p>
 
639
<a href="master.5.html">master.cf</a> file by prepending an IP address to a server name. </p>
640
640
 
641
641
<p> The default is to listen on all active interfaces.  If you run
642
642
mailers on virtual interfaces, you will have to specify what
652
652
 
653
653
<blockquote>
654
654
<pre>
655
 
/etc/postfix/main.cf:
 
655
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
656
656
    <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = all
657
657
</pre>
658
658
</blockquote>
662
662
 
663
663
<blockquote>
664
664
<pre>
665
 
/etc/postfix/main.cf:
 
665
/etc/postfix/<a href="postconf.5.html">main.cf</a>:
666
666
    <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = virtual.host.tld         (virtual Postfix)
667
667
    <a href="postconf.5.html#inet_interfaces">inet_interfaces</a> = $<a href="postconf.5.html#myhostname">myhostname</a> localhost... (non-virtual Postfix)
668
668
</pre>