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