Wiki source code of Postfix configuration

Last modified by Alexandru Pentilescu on 2026/02/08 14:31

Hide last authors
Alexandru Pentilescu 1.1 1 (% class="jumbotron" %)
2 (((
3 (% class="container" %)
4 (((
5 = VPS =
6 This will document my existing postfix installation. This is a mail server that I'm using to relay email notifications from my various docker containers to external email addresses owned by me or other people.
7 )))
8 )))
9
10 (% class="row" %)
11 (((
12 (% class="col-xs-12 col-sm-8" %)
13 (((
14 = Main configuration =
15
16 The following is the configuration of the /etc/postfix/main.cf file.
17
18 {{code language="INI"}}
19 # See /usr/share/postfix/main.cf.dist for a commented, more complete version
20
21
22 # Debian specific: Specifying a file name will cause the first
23 # line of that file to be used as the name. The Debian default
24 # is /etc/mailname.
25 #myorigin = /etc/mailname
26
27 smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
28 biff = no
29
30 # appending .domain is the MUA's job.
31 append_dot_mydomain = no
32
33 # Uncomment the next line to generate "delayed mail" warnings
34 #delay_warning_time = 4h
35
36 readme_directory = no
37
38 # See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
39 # fresh installs.
40 compatibility_level = 3.6
41
42
43
44 # TLS parameters
45 smtpd_tls_cert_file=/etc/letsencrypt/live/transistor.one/fullchain.pem
46 smtpd_tls_key_file=/etc/letsencrypt/live/transistor.one/privkey.pem
47 smtpd_tls_security_level=may
48
49 smtp_tls_CApath=/etc/ssl/certs
50 smtp_tls_security_level=may
51 smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
52
53
54 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
55 myhostname = mail.transistor.one
56 alias_maps = hash:/etc/aliases
57 alias_database = hash:/etc/aliases
58 myorigin = /etc/mailname
59 mydestination = $myhostname, transistor.one, localhost.one, localhost
60 relayhost =
61 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.16.0.0/12
62 mailbox_size_limit = 0
63 recipient_delimiter = +
64 inet_interfaces = all
65 inet_protocols = all
66
67 {{/code}}
68
69
70 (% class="col-xs-12 col-sm-4" %)
71 (((
72 {{box title="**Contents**"}}{{toc /}}{{/box}}
73
74 )))
75 )))