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