blob: 02539c00f7864176039ec705d4df36b7a718aaf5 [file] [log] [blame]
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +01001# --------------------------------------------------------------------------
2# Please create a file "extra.cf" for persistent overrides to main.cf
3# --------------------------------------------------------------------------
4biff = no
5append_dot_mydomain = no
6smtpd_tls_cert_file = /etc/ssl/mail/cert.pem
7smtpd_tls_key_file = /etc/ssl/mail/key.pem
8tls_server_sni_maps = hash:/opt/postfix/conf/sni.map
9smtpd_tls_received_header = yes
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010010smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
11smtpd_relay_restrictions = permit_mynetworks,
12 permit_sasl_authenticated,
13 defer_unauth_destination
14# alias maps are auto-generated in postfix.sh on startup
15alias_maps = hash:/etc/aliases
16alias_database = hash:/etc/aliases
17relayhost =
Matthias Andreas Benkardf9b59482022-12-28 21:25:11 +010018mynetworks_style = subnet
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010019mailbox_size_limit = 0
20recipient_delimiter = +
21inet_interfaces = all
22inet_protocols = all
23bounce_queue_lifetime = 1d
24broken_sasl_auth_clients = yes
25disable_vrfy_command = yes
26maximal_backoff_time = 1800s
27maximal_queue_lifetime = 5d
28delay_warning_time = 4h
29message_size_limit = 104857600
Matthias Andreas Benkardf9b59482022-12-28 21:25:11 +010030milter_default_action = accept
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010031milter_protocol = 6
32minimal_backoff_time = 300s
33plaintext_reject_code = 550
34postscreen_access_list = permit_mynetworks,
35 cidr:/opt/postfix/conf/custom_postscreen_whitelist.cidr,
36 cidr:/opt/postfix/conf/postscreen_access.cidr,
37 tcp:127.0.0.1:10027
38postscreen_bare_newline_enable = no
39postscreen_blacklist_action = drop
40postscreen_cache_cleanup_interval = 24h
41postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
42postscreen_dnsbl_action = enforce
43postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
44 hostkarma.junkemailfilter.com=127.0.0.1*-2
45 list.dnswl.org=127.0.[0..255].0*-2
46 list.dnswl.org=127.0.[0..255].1*-4
47 list.dnswl.org=127.0.[0..255].2*-6
48 list.dnswl.org=127.0.[0..255].3*-8
49 ix.dnsbl.manitu.net*2
50 bl.spamcop.net*2
51 bl.suomispam.net*2
52 hostkarma.junkemailfilter.com=127.0.0.2*3
53 hostkarma.junkemailfilter.com=127.0.0.4*2
54 hostkarma.junkemailfilter.com=127.0.1.2*1
55 backscatter.spameatingmonkey.net*2
56 bl.ipv6.spameatingmonkey.net*2
57 bl.spameatingmonkey.net*2
58 b.barracudacentral.org=127.0.0.2*7
59 bl.mailspike.net=127.0.0.2*5
60 bl.mailspike.net=127.0.0.[10;11;12]*4
61 dnsbl.sorbs.net=127.0.0.10*8
62 dnsbl.sorbs.net=127.0.0.5*6
63 dnsbl.sorbs.net=127.0.0.7*3
64 dnsbl.sorbs.net=127.0.0.8*2
65 dnsbl.sorbs.net=127.0.0.6*2
66 dnsbl.sorbs.net=127.0.0.9*2
67 zen.spamhaus.org=127.0.0.[10;11]*8
68 zen.spamhaus.org=127.0.0.[4..7]*6
69 zen.spamhaus.org=127.0.0.3*4
70 zen.spamhaus.org=127.0.0.2*3
71postscreen_dnsbl_threshold = 6
72postscreen_dnsbl_ttl = 5m
73postscreen_greet_action = enforce
74postscreen_greet_banner = $smtpd_banner
75postscreen_greet_ttl = 2d
76postscreen_greet_wait = 3s
77postscreen_non_smtp_command_enable = no
78postscreen_pipelining_enable = no
79proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020080 proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010081 proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
82 $sender_dependent_default_transport_maps,
83 $smtp_tls_policy_maps,
84 $local_recipient_maps,
85 $mydestination,
86 $virtual_alias_maps,
87 $virtual_alias_domains,
88 $virtual_mailbox_maps,
89 $virtual_mailbox_domains,
90 $relay_recipient_maps,
91 $relay_domains,
92 $canonical_maps,
93 $sender_canonical_maps,
94 $sender_bcc_maps,
95 $recipient_bcc_maps,
96 $recipient_canonical_maps,
97 $relocated_maps,
98 $transport_maps,
99 $mynetworks,
100 $smtpd_sender_login_maps,
101 $smtp_sasl_password_maps
102queue_run_delay = 300s
103relay_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_relay_domain_maps.cf
104relay_recipient_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
105sender_dependent_default_transport_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_dependent_default_transport_maps.cf
106smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
107smtp_tls_cert_file = /etc/ssl/mail/cert.pem
108smtp_tls_key_file = /etc/ssl/mail/key.pem
109smtp_tls_loglevel = 1
110smtp_dns_support_level = dnssec
111smtp_tls_security_level = dane
112smtpd_data_restrictions = reject_unauth_pipelining, permit
113smtpd_delay_reject = yes
114smtpd_error_sleep_time = 10s
115smtpd_hard_error_limit = ${stress?1}${stress:5}
116smtpd_helo_required = yes
117smtpd_proxy_timeout = 600s
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200118smtpd_recipient_restrictions = check_recipient_mx_access proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100119 permit_sasl_authenticated,
120 permit_mynetworks,
121 check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
122 reject_invalid_helo_hostname,
123 reject_unauth_destination
124smtpd_sasl_auth_enable = yes
125smtpd_sasl_authenticated_header = yes
126smtpd_sasl_path = inet:dovecot:10001
127smtpd_sasl_type = dovecot
128smtpd_sender_login_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_sender_acl.cf
129smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
130 permit_mynetworks,
131 permit_sasl_authenticated,
132 reject_unlisted_sender,
133 reject_unknown_sender_domain
134smtpd_soft_error_limit = 3
135smtpd_tls_auth_only = yes
136smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams.pem
137smtpd_tls_eecdh_grade = auto
138smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL, DES-CBC3-SHA, ECDHE-RSA-DES-CBC3-SHA, EDH-RSA-DES-CBC3-SHA
139smtpd_tls_loglevel = 1
140
141# Mandatory protocols and ciphers are used when a connections is enforced to use TLS
142# Does _not_ apply to enforced incoming TLS settings per mailbox
143smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
144lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
145smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
146smtpd_tls_mandatory_ciphers = high
147
148smtp_tls_protocols = !SSLv2, !SSLv3
149lmtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
150smtpd_tls_protocols = !SSLv2, !SSLv3
151
152smtpd_tls_security_level = may
153tls_preempt_cipherlist = yes
154tls_ssl_options = NO_COMPRESSION, NO_RENEGOTIATION
155virtual_alias_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_maps.cf,
156 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_resource_maps.cf,
157 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_spamalias_maps.cf,
158 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
159virtual_gid_maps = static:5000
160virtual_mailbox_base = /var/vmail/
161virtual_mailbox_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_domains_maps.cf
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200162# -- moved to rspamd on 2021-06-01
163#recipient_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf
164#sender_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_bcc_maps.cf
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100165recipient_canonical_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_canonical_maps.cf
166recipient_canonical_classes = envelope_recipient
167virtual_mailbox_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_mailbox_maps.cf
168virtual_minimum_uid = 104
169virtual_transport = lmtp:inet:dovecot:24
170virtual_uid_maps = static:5000
171smtpd_milters = inet:rspamd:9900
172non_smtpd_milters = inet:rspamd:9900
173milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
174mydestination = localhost.localdomain, localhost
175smtp_address_preference = any
176smtp_sender_dependent_authentication = yes
177smtp_sasl_auth_enable = yes
178smtp_sasl_password_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_sender_dependent.cf
179smtp_sasl_security_options =
180smtp_sasl_mechanism_filter = plain, login
181smtp_tls_policy_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_tls_policy_override_maps.cf
182smtp_header_checks = pcre:/opt/postfix/conf/anonymize_headers.pcre
183mail_name = Postcow
184# local_transport map catches local destinations and prevents routing local dests when the next map would route "*"
185# Use custom_transport.pcre for custom transports
186transport_maps = pcre:/opt/postfix/conf/custom_transport.pcre,
187 pcre:/opt/postfix/conf/local_transport,
188 proxy:mysql:/opt/postfix/conf/sql/mysql_relay_ne.cf,
189 proxy:mysql:/opt/postfix/conf/sql/mysql_transport_maps.cf
190smtp_sasl_auth_soft_bounce = no
191postscreen_discard_ehlo_keywords = silent-discard, dsn
192compatibility_level = 2
193smtputf8_enable = no
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100194# Define protocols for SMTPS and submission service
195submission_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
196smtps_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200197parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,qmqpd_authorized_clients
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100198
199# DO NOT EDIT ANYTHING BELOW #
200# User overrides #
Matthias Andreas Benkardf9b59482022-12-28 21:25:11 +0100201
202myhostname = mail.benkard.de
203mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.22.1.0/24 [fe80::]/10 [fc00::]/7