mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-31 07:09:57 +02:00
scripts: housekeeping & cleanup setup (1/2) (#3121)
This commit is contained in:
parent
f35b60042f
commit
4b04c3e31c
11 changed files with 233 additions and 262 deletions
32
target/scripts/startup/setup.d/security/spoofing.sh
Normal file
32
target/scripts/startup/setup.d/security/spoofing.sh
Normal file
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
function _setup_spoof_protection
|
||||
{
|
||||
if [[ ${SPOOF_PROTECTION} -eq 1 ]]
|
||||
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} ]]
|
||||
then
|
||||
postconf 'smtpd_sender_login_maps = ldap:/etc/postfix/ldap-users.cf ldap:/etc/postfix/ldap-aliases.cf ldap:/etc/postfix/ldap-groups.cf'
|
||||
else
|
||||
postconf 'smtpd_sender_login_maps = ldap:/etc/postfix/ldap-senders.cf'
|
||||
fi
|
||||
else
|
||||
if [[ -f /etc/postfix/regexp ]]
|
||||
then
|
||||
postconf 'smtpd_sender_login_maps = unionmap:{ texthash:/etc/postfix/virtual, hash:/etc/aliases, pcre:/etc/postfix/maps/sender_login_maps.pcre, pcre:/etc/postfix/regexp }'
|
||||
else
|
||||
postconf 'smtpd_sender_login_maps = texthash:/etc/postfix/virtual, hash:/etc/aliases, pcre:/etc/postfix/maps/sender_login_maps.pcre'
|
||||
fi
|
||||
fi
|
||||
else
|
||||
_log 'debug' 'Spoof protection is disabled'
|
||||
fi
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue