blob: e8da7947669723a829743f688d17c88c0dfaa888 [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
10smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
11smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
12smtpd_relay_restrictions = permit_mynetworks,
13 permit_sasl_authenticated,
14 defer_unauth_destination
15# alias maps are auto-generated in postfix.sh on startup
16alias_maps = hash:/etc/aliases
17alias_database = hash:/etc/aliases
18relayhost =
19mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 [fe80::]/10 [fc00::]/7
20mailbox_size_limit = 0
21recipient_delimiter = +
22inet_interfaces = all
23inet_protocols = all
24bounce_queue_lifetime = 1d
25broken_sasl_auth_clients = yes
26disable_vrfy_command = yes
27maximal_backoff_time = 1800s
28maximal_queue_lifetime = 5d
29delay_warning_time = 4h
30message_size_limit = 104857600
31milter_default_action = accept
32milter_protocol = 6
33minimal_backoff_time = 300s
34plaintext_reject_code = 550
35postscreen_access_list = permit_mynetworks,
36 cidr:/opt/postfix/conf/custom_postscreen_whitelist.cidr,
37 cidr:/opt/postfix/conf/postscreen_access.cidr,
38 tcp:127.0.0.1:10027
39postscreen_bare_newline_enable = no
40postscreen_blacklist_action = drop
41postscreen_cache_cleanup_interval = 24h
42postscreen_cache_map = proxy:btree:$data_directory/postscreen_cache
43postscreen_dnsbl_action = enforce
44postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
45 hostkarma.junkemailfilter.com=127.0.0.1*-2
46 list.dnswl.org=127.0.[0..255].0*-2
47 list.dnswl.org=127.0.[0..255].1*-4
48 list.dnswl.org=127.0.[0..255].2*-6
49 list.dnswl.org=127.0.[0..255].3*-8
50 ix.dnsbl.manitu.net*2
51 bl.spamcop.net*2
52 bl.suomispam.net*2
53 hostkarma.junkemailfilter.com=127.0.0.2*3
54 hostkarma.junkemailfilter.com=127.0.0.4*2
55 hostkarma.junkemailfilter.com=127.0.1.2*1
56 backscatter.spameatingmonkey.net*2
57 bl.ipv6.spameatingmonkey.net*2
58 bl.spameatingmonkey.net*2
59 b.barracudacentral.org=127.0.0.2*7
60 bl.mailspike.net=127.0.0.2*5
61 bl.mailspike.net=127.0.0.[10;11;12]*4
62 dnsbl.sorbs.net=127.0.0.10*8
63 dnsbl.sorbs.net=127.0.0.5*6
64 dnsbl.sorbs.net=127.0.0.7*3
65 dnsbl.sorbs.net=127.0.0.8*2
66 dnsbl.sorbs.net=127.0.0.6*2
67 dnsbl.sorbs.net=127.0.0.9*2
68 zen.spamhaus.org=127.0.0.[10;11]*8
69 zen.spamhaus.org=127.0.0.[4..7]*6
70 zen.spamhaus.org=127.0.0.3*4
71 zen.spamhaus.org=127.0.0.2*3
72postscreen_dnsbl_threshold = 6
73postscreen_dnsbl_ttl = 5m
74postscreen_greet_action = enforce
75postscreen_greet_banner = $smtpd_banner
76postscreen_greet_ttl = 2d
77postscreen_greet_wait = 3s
78postscreen_non_smtp_command_enable = no
79postscreen_pipelining_enable = no
80proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
81 proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_access_maps.cf,
82 proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
83 $sender_dependent_default_transport_maps,
84 $smtp_tls_policy_maps,
85 $local_recipient_maps,
86 $mydestination,
87 $virtual_alias_maps,
88 $virtual_alias_domains,
89 $virtual_mailbox_maps,
90 $virtual_mailbox_domains,
91 $relay_recipient_maps,
92 $relay_domains,
93 $canonical_maps,
94 $sender_canonical_maps,
95 $sender_bcc_maps,
96 $recipient_bcc_maps,
97 $recipient_canonical_maps,
98 $relocated_maps,
99 $transport_maps,
100 $mynetworks,
101 $smtpd_sender_login_maps,
102 $smtp_sasl_password_maps
103queue_run_delay = 300s
104relay_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_relay_domain_maps.cf
105relay_recipient_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
106sender_dependent_default_transport_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_dependent_default_transport_maps.cf
107smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
108smtp_tls_cert_file = /etc/ssl/mail/cert.pem
109smtp_tls_key_file = /etc/ssl/mail/key.pem
110smtp_tls_loglevel = 1
111smtp_dns_support_level = dnssec
112smtp_tls_security_level = dane
113smtpd_data_restrictions = reject_unauth_pipelining, permit
114smtpd_delay_reject = yes
115smtpd_error_sleep_time = 10s
116smtpd_hard_error_limit = ${stress?1}${stress:5}
117smtpd_helo_required = yes
118smtpd_proxy_timeout = 600s
119smtpd_recipient_restrictions = check_sasl_access proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_access_maps.cf,
120 permit_sasl_authenticated,
121 permit_mynetworks,
122 check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
123 reject_invalid_helo_hostname,
124 reject_unauth_destination
125smtpd_sasl_auth_enable = yes
126smtpd_sasl_authenticated_header = yes
127smtpd_sasl_path = inet:dovecot:10001
128smtpd_sasl_type = dovecot
129smtpd_sender_login_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_sender_acl.cf
130smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
131 permit_mynetworks,
132 permit_sasl_authenticated,
133 reject_unlisted_sender,
134 reject_unknown_sender_domain
135smtpd_soft_error_limit = 3
136smtpd_tls_auth_only = yes
137smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams.pem
138smtpd_tls_eecdh_grade = auto
139smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL, DES-CBC3-SHA, ECDHE-RSA-DES-CBC3-SHA, EDH-RSA-DES-CBC3-SHA
140smtpd_tls_loglevel = 1
141
142# Mandatory protocols and ciphers are used when a connections is enforced to use TLS
143# Does _not_ apply to enforced incoming TLS settings per mailbox
144smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
145lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
146smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
147smtpd_tls_mandatory_ciphers = high
148
149smtp_tls_protocols = !SSLv2, !SSLv3
150lmtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
151smtpd_tls_protocols = !SSLv2, !SSLv3
152
153smtpd_tls_security_level = may
154tls_preempt_cipherlist = yes
155tls_ssl_options = NO_COMPRESSION, NO_RENEGOTIATION
156virtual_alias_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_maps.cf,
157 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_resource_maps.cf,
158 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_spamalias_maps.cf,
159 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
160virtual_gid_maps = static:5000
161virtual_mailbox_base = /var/vmail/
162virtual_mailbox_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_domains_maps.cf
163recipient_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf
164sender_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_bcc_maps.cf
165recipient_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
194smtpd_last_auth = check_policy_service inet:127.0.0.1:10028
195# Define protocols for SMTPS and submission service
196submission_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
197smtps_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
198
199# DO NOT EDIT ANYTHING BELOW #
200# User overrides #
201