2 ################################################
3 ### Managed by someone's ansible provisioner ###
4 ################################################
5 # Part of: https://git.somenet.org/root/pub/somesible.git
6 # 2017-2026 by someone <someone@somenet.org>
9 # Last time we extensively looked at our configuration.
10 compatibility_level=3.6
13 myhostname = mail.somenet.org
15 mydestination = mail.l, l, localhost, localhost.localdomain
16 mynetworks = 10.0.0.0/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
20 smtpd_tls_chain_files =
21 /etc/ssl/letsencrypt/mail.somenet.org/privkey.pem,
22 /etc/ssl/letsencrypt/mail.somenet.org/fullchain.pem,
23 /etc/ssl/letsencrypt-rsa/mail.somenet.org/privkey.pem,
24 /etc/ssl/letsencrypt-rsa/mail.somenet.org/fullchain.pem
25 smtpd_tls_security_level = may
26 smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
27 smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
28 smtpd_tls_ciphers = high
29 smtpd_tls_mandatory_ciphers = high
30 smtpd_tls_loglevel = 1
31 smtpd_tls_received_header = yes
32 smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
33 smtpd_tls_auth_only = yes
34 # we override this for the "submission" service.
35 smtpd_sasl_auth_enable = no
36 smtpd_sasl_path = smtpd
37 smtpd_banner = $myhostname ESMTP $mail_name
38 smtpd_helo_required = yes
39 # fuck sec consult and their business "ethics".
40 smtpd_forbid_bare_newline = yes
41 smtpd_forbid_unauth_pipelining = yes
42 smtpd_discard_ehlo_keywords = chunking, silent-discard
45 # header cleanup + transport mapping
46 header_checks = regexp:/etc/postfix/header_checks_in.regexp
47 nested_header_checks =
48 transport_maps = hash:/etc/postfix/transport.map
49 #, hash:/var/lib/sympa/transport.map
53 smtp_tls_security_level = may
54 smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
55 smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
56 smtp_tls_ciphers = high
57 smtp_tls_mandatory_ciphers = high
59 smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
60 smtp_header_checks = regexp:/etc/postfix/header_checks_out.regexp
63 # tls - use openssl defaults (seem stronger)
64 tls_eecdh_auto_curves =
65 tls_ffdhe_auto_groups =
66 tls_config_file = none
70 virtual_alias_domains = somenet.org
71 virtual_alias_maps = hash:/etc/postfix/virtual.map
72 #,ldap:/etc/postfix/virtual.ldap
76 mailbox_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp
77 mailbox_size_limit = 209715200
81 # todo: flip vmailbox und valias domains?
82 #virtual_mailbox_domains = lists.somenet.org
83 #virtual_mailbox_maps = hash:/etc/postfix/virtual.map, hash:/etc/postfix/transport.map, hash:/var/lib/sympa/transport.map
88 connection_cache_status_update_time = 3600
89 cyrus_sasl_config_path = /etc/postfix/sasl
91 message_size_limit = $mailbox_size_limit
92 recipient_delimiter = +
93 tls_preempt_cipherlist = yes
96 default_destination_concurrency_limit = 2
98 # disable smtputf8 because of cyrus
102 #########################################
103 # DONT BE AN OPEN RELAY. RESTRICT STUFF #
104 #########################################
105 smtpd_restriction_classes = HOLD_OK
106 HOLD_OK = check_client_access static:hold, permit
109 # 1. check every incomming connecting.
110 # we use master.cf to overridden this for the "submission" service to always require authentication:
111 # smtpd_client_restrictions = permit_sasl_authenticated, reject
112 # we merge that into recipient and relay restrictions - no need to check everything multiple times.
113 #smtpd_client_restrictions =
115 # permit_sasl_authenticated,
116 # reject_unknown_client_hostname,
120 # 2. check the helo of the incomming connection.
121 # we merge that into recipient and relay restrictions - no need to check everything multiple times.
122 # smtpd_helo_restrictions =
124 # permit_sasl_authenticated,
125 # reject_invalid_helo_hostname,
126 # reject_unknown_helo_hostname,
130 # 3. checks run after a connection issues "MAIL FROM"
131 # we merge that into recipient and relay restrictions - no need to check everything multiple times.
132 # smtpd_sender_restrictions =
133 # check_sender_access regexp:/etc/postfix/sender_restrictions.regexp,
135 # permit_sasl_authenticated,
136 # reject_non_fqdn_sender,
137 # reject_unknown_sender_domain,
141 # 4a. checks run after a connection issues "RCPT TO"
142 smtpd_recipient_restrictions =
143 check_sender_access regexp:/etc/postfix/rcpt_sender.regexp,
144 check_recipient_access regexp:/etc/postfix/rcpt_recipient.regexp,
146 permit_sasl_authenticated,
147 permit_auth_destination,
148 reject_invalid_helo_hostname,
149 reject_unauth_pipelining,
150 reject_unauth_destination,
151 reject_non_fqdn_sender,
152 reject_non_fqdn_recipient,
153 reject_unknown_client_hostname,
154 reject_unknown_helo_hostname,
155 reject_unknown_sender_domain,
156 reject_unknown_recipient_domain,
160 # 4b. same as smtpd_recipient_restrictions but diffrent.
161 smtpd_relay_restrictions =
162 check_sender_access regexp:/etc/postfix/rel_sender.regexp,
163 check_recipient_access regexp:/etc/postfix/rel_recipient.regexp,
164 check_sender_access regexp:/etc/postfix/rcpt_sender.regexp,
165 check_recipient_access regexp:/etc/postfix/rcpt_recipient.regexp,
167 permit_sasl_authenticated,
168 permit_auth_destination,
169 reject_invalid_helo_hostname,
170 reject_unauth_pipelining,
171 reject_unauth_destination,
172 reject_non_fqdn_sender,
173 reject_non_fqdn_recipient,
174 reject_unknown_client_hostname,
175 reject_unknown_helo_hostname,
176 reject_unknown_sender_domain,
177 reject_unknown_recipient_domain,
181 # 5. checks run after a connection issues "RCPT TO"
182 # we merge that into recipient and relay restrictions - no need to check everything multiple times.
183 # smtpd_data_restrictions =
185 # permit_sasl_authenticated,
186 # reject_unauth_pipelining,