@@ -165,35 +165,54 @@ delay_warning_time=3h
165165maximal_queue_lifetime=2d
166166bounce_queue_lifetime=1d
167167
168+ # submission sender restrictions
169+ smtpd_sender_restrictions = reject_sender_login_mismatch,
170+ permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,
171+ reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
172+ reject_unauth_pipelining,
173+ reject
174+
168175{% if mailserver_behind_proxy %}
169176# We're behind a forwaring proxy that does antispam. Mails therefore do not get delivered to us
170177# from their original sender, therefore, we can't do DNS checks!
171178
172179# smtpd sender restrictions
173- smtpd_sender_restrictions = reject_sender_login_mismatch,
174- permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,
180+ smtpd_sender_restrictions_25 = permit_mynetworks,
181+ {% if mailserver_config_method == "ldap" %} check_recipient_access ldap:/etc/postfix/ldap-external-receive.cf,
182+ {% endif %}
183+ reject_unauth_destination,
175184 reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
176185 reject_unauth_pipelining, check_client_access hash:/etc/postfix/allowed_proxies,
177186 reject
178187
179188# smtp destination restrictions
180189# Either you're authenticated OR you are from 127.0.0.1 OR you satisfy a boatload of constraints
181190# Also note that the same thing ist in master.cf without sasl restrictions
191+ smtpd_recipient_restrictions_25 = permit_mynetworks, reject_unknown_recipient_domain, reject_unauth_pipelining,
192+ reject_unauth_destination, reject_multi_recipient_bounce, permit
193+
182194smtpd_recipient_restrictions = reject_sender_login_mismatch, permit_sasl_authenticated,
183195 permit_mynetworks, reject_unknown_recipient_domain, reject_unauth_pipelining,
184196 reject_unauth_destination, reject_multi_recipient_bounce, check_client_access hash:/etc/postfix/allowed_proxies,
185197 reject
186198{% else %}
187199# smtpd sender restrictions
188- smtpd_sender_restrictions = reject_sender_login_mismatch,
189- permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,
200+ smtpd_sender_restrictions_25 = permit_mynetworks,
201+ {% if mailserver_config_method == "ldap" %} check_recipient_access ldap:/etc/postfix/ldap-external-receive.cf,
202+ {% endif %}
203+ reject_unauth_destination,
190204 reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
191205 reject_unauth_pipelining, permit
192206
193207# smtp destination restrictions
194208# Either you're authenticated OR you are from 127.0.0.1 OR you satisfy a boatload of constraints
195209# We need to find out in prod if this is too restrictive
196210# Also note that the same thing ist in master.cf without sasl restrictions
211+ smtpd_recipient_restrictions_25 = permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_hostname,
212+ reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_sender_domain,
213+ reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination,
214+ reject_multi_recipient_bounce, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, permit
215+
197216smtpd_recipient_restrictions = reject_sender_login_mismatch,
198217{% if mailserver_config_method == "ldap" %} check_sender_access ldap:/etc/postfix/ldap-external-send.cf,
199218{% endif %}
0 commit comments