config/ENV: improve Postfix config for spoof protection (#3127)

This commit is contained in:
Georg Lauterbach 2023-03-03 15:55:32 +01:00 committed by GitHub
parent aa4d4fe315
commit 5ec6845c96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 15 deletions

View file

@ -6,10 +6,6 @@ function _setup_spoof_protection
then
_log 'trace' 'Enabling and configuring spoof protection'
sed -i \
's|smtpd_sender_restrictions =|smtpd_sender_restrictions = reject_authenticated_sender_login_mismatch,|' \
/etc/postfix/main.cf
if [[ ${ACCOUNT_PROVISIONER} == 'LDAP' ]]
then
if [[ -z ${LDAP_QUERY_FILTER_SENDERS} ]]
@ -28,5 +24,7 @@ function _setup_spoof_protection
fi
else
_log 'debug' 'Spoof protection is disabled'
# shellcheck disable=SC2016
postconf 'mua_sender_restrictions = $dms_smtpd_sender_restrictions'
fi
}