blob: bb68e393ac6be262d03b7380ae8e7af640ab8061 [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 Benkardd1f5b682023-11-18 13:18:30 +010030milter_default_action = tempfail
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
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010043postscreen_dnsbl_threshold = 6
44postscreen_dnsbl_ttl = 5m
45postscreen_greet_action = enforce
46postscreen_greet_banner = $smtpd_banner
47postscreen_greet_ttl = 2d
48postscreen_greet_wait = 3s
49postscreen_non_smtp_command_enable = no
50postscreen_pipelining_enable = no
51proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020052 proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +010053 proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
54 $sender_dependent_default_transport_maps,
55 $smtp_tls_policy_maps,
56 $local_recipient_maps,
57 $mydestination,
58 $virtual_alias_maps,
59 $virtual_alias_domains,
60 $virtual_mailbox_maps,
61 $virtual_mailbox_domains,
62 $relay_recipient_maps,
63 $relay_domains,
64 $canonical_maps,
65 $sender_canonical_maps,
66 $sender_bcc_maps,
67 $recipient_bcc_maps,
68 $recipient_canonical_maps,
69 $relocated_maps,
70 $transport_maps,
71 $mynetworks,
72 $smtpd_sender_login_maps,
73 $smtp_sasl_password_maps
74queue_run_delay = 300s
75relay_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_relay_domain_maps.cf
76relay_recipient_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_relay_recipient_maps.cf
77sender_dependent_default_transport_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_dependent_default_transport_maps.cf
78smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
79smtp_tls_cert_file = /etc/ssl/mail/cert.pem
80smtp_tls_key_file = /etc/ssl/mail/key.pem
81smtp_tls_loglevel = 1
82smtp_dns_support_level = dnssec
83smtp_tls_security_level = dane
84smtpd_data_restrictions = reject_unauth_pipelining, permit
85smtpd_delay_reject = yes
86smtpd_error_sleep_time = 10s
87smtpd_hard_error_limit = ${stress?1}${stress:5}
88smtpd_helo_required = yes
89smtpd_proxy_timeout = 600s
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +020090smtpd_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 +010091 permit_sasl_authenticated,
92 permit_mynetworks,
93 check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
94 reject_invalid_helo_hostname,
95 reject_unauth_destination
96smtpd_sasl_auth_enable = yes
97smtpd_sasl_authenticated_header = yes
98smtpd_sasl_path = inet:dovecot:10001
99smtpd_sasl_type = dovecot
100smtpd_sender_login_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_sender_acl.cf
101smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,
102 permit_mynetworks,
103 permit_sasl_authenticated,
104 reject_unlisted_sender,
105 reject_unknown_sender_domain
106smtpd_soft_error_limit = 3
107smtpd_tls_auth_only = yes
108smtpd_tls_dh1024_param_file = /etc/ssl/mail/dhparams.pem
109smtpd_tls_eecdh_grade = auto
110smtpd_tls_exclude_ciphers = ECDHE-RSA-RC4-SHA, RC4, aNULL, DES-CBC3-SHA, ECDHE-RSA-DES-CBC3-SHA, EDH-RSA-DES-CBC3-SHA
111smtpd_tls_loglevel = 1
112
113# Mandatory protocols and ciphers are used when a connections is enforced to use TLS
114# Does _not_ apply to enforced incoming TLS settings per mailbox
115smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
116lmtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
117smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
118smtpd_tls_mandatory_ciphers = high
119
120smtp_tls_protocols = !SSLv2, !SSLv3
121lmtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
122smtpd_tls_protocols = !SSLv2, !SSLv3
123
124smtpd_tls_security_level = may
125tls_preempt_cipherlist = yes
126tls_ssl_options = NO_COMPRESSION, NO_RENEGOTIATION
127virtual_alias_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_maps.cf,
128 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_resource_maps.cf,
129 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_spamalias_maps.cf,
130 proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
131virtual_gid_maps = static:5000
132virtual_mailbox_base = /var/vmail/
133virtual_mailbox_domains = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_domains_maps.cf
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200134# -- moved to rspamd on 2021-06-01
135#recipient_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_bcc_maps.cf
136#sender_bcc_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sender_bcc_maps.cf
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100137recipient_canonical_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_recipient_canonical_maps.cf
138recipient_canonical_classes = envelope_recipient
139virtual_mailbox_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_virtual_mailbox_maps.cf
140virtual_minimum_uid = 104
141virtual_transport = lmtp:inet:dovecot:24
142virtual_uid_maps = static:5000
143smtpd_milters = inet:rspamd:9900
144non_smtpd_milters = inet:rspamd:9900
145milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen}
146mydestination = localhost.localdomain, localhost
147smtp_address_preference = any
148smtp_sender_dependent_authentication = yes
149smtp_sasl_auth_enable = yes
150smtp_sasl_password_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_sender_dependent.cf
151smtp_sasl_security_options =
152smtp_sasl_mechanism_filter = plain, login
153smtp_tls_policy_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_tls_policy_override_maps.cf
154smtp_header_checks = pcre:/opt/postfix/conf/anonymize_headers.pcre
155mail_name = Postcow
156# local_transport map catches local destinations and prevents routing local dests when the next map would route "*"
157# Use custom_transport.pcre for custom transports
158transport_maps = pcre:/opt/postfix/conf/custom_transport.pcre,
159 pcre:/opt/postfix/conf/local_transport,
160 proxy:mysql:/opt/postfix/conf/sql/mysql_relay_ne.cf,
161 proxy:mysql:/opt/postfix/conf/sql/mysql_transport_maps.cf
162smtp_sasl_auth_soft_bounce = no
163postscreen_discard_ehlo_keywords = silent-discard, dsn
164compatibility_level = 2
165smtputf8_enable = no
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100166# Define protocols for SMTPS and submission service
167submission_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
168smtps_smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
Matthias Andreas Benkard7b2a3a12021-08-16 10:57:25 +0200169parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,qmqpd_authorized_clients
Matthias Andreas Benkardb382b102021-01-02 15:32:21 +0100170
171# DO NOT EDIT ANYTHING BELOW #
Matthias Andreas Benkardd1f5b682023-11-18 13:18:30 +0100172# Overrides #
Matthias Andreas Benkardf9b59482022-12-28 21:25:11 +0100173myhostname = mail.benkard.de
174mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.22.1.0/24 [fe80::]/10 [fc00::]/7