@@ -164,33 +164,41 @@ delay_warning_time=3h
164164maximal_queue_lifetime=2d
165165bounce_queue_lifetime=1d
166166
167- {% if mailserver_behind_proxy %}
168- # We're behind a forwaring proxy that does antispam. Mails therefore do not get delivered to us
169- # from their original sender, therefore, we can't do DNS checks!
170-
171167# smtpd sender restrictions
168+ smtpd_sender_restrictions_25 = permit_mynetworks,
169+ {% if mailserver_config_method == "ldap" %} check_recipient_access ldap:/etc/postfix/ldap-external-receive.cf,
170+ {% endif %}
171+ permit_mynetworks, reject_unauth_destination,
172+ reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
173+ reject_unauth_pipelining, permit
172174smtpd_sender_restrictions = reject_sender_login_mismatch,
173175 permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,
174176 reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
175177 reject_unauth_pipelining, permit
176178
179+ {% if mailserver_behind_proxy %}
180+ # We're behind a forwaring proxy that does antispam. Mails therefore do not get delivered to us
181+ # from their original sender, therefore, we can't do DNS checks!
182+
177183# smtp destination restrictions
178184# Either you're authenticated OR you are from 127.0.0.1 OR you satisfy a boatload of constraints
179185# Also note that the same thing ist in master.cf without sasl restrictions
186+ smtpd_recipient_restrictions_25 = permit_mynetworks, reject_unknown_recipient_domain, reject_unauth_pipelining,
187+ reject_unauth_destination, reject_multi_recipient_bounce, permit
188+
180189smtpd_recipient_restrictions = reject_sender_login_mismatch, permit_sasl_authenticated,
181190 permit_mynetworks, reject_unknown_recipient_domain, reject_unauth_pipelining,
182191 reject_unauth_destination, reject_multi_recipient_bounce, permit
183192{% else %}
184- # smtpd sender restrictions
185- smtpd_sender_restrictions = reject_sender_login_mismatch,
186- permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination,
187- reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_recipient_domain,
188- reject_unauth_pipelining, permit
189-
190193# smtp destination restrictions
191194# Either you're authenticated OR you are from 127.0.0.1 OR you satisfy a boatload of constraints
192195# We need to find out in prod if this is too restrictive
193196# Also note that the same thing ist in master.cf without sasl restrictions
197+ smtpd_recipient_restrictions_25 = permit_mynetworks, reject_invalid_hostname, reject_non_fqdn_hostname,
198+ reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unknown_sender_domain,
199+ reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination,
200+ reject_multi_recipient_bounce, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, permit
201+
194202smtpd_recipient_restrictions = reject_sender_login_mismatch,
195203{% if mailserver_config_method == "ldap" %} check_sender_access ldap:/etc/postfix/ldap-external-send.cf,
196204{% endif %}
0 commit comments