mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-31 08:04:46 +02:00
scripts: split setup-stack.sh
(#3115)
This commit is contained in:
parent
1592698637
commit
f35b60042f
18 changed files with 1205 additions and 1184 deletions
47
target/scripts/startup/setup.d/saslauthd.sh
Normal file
47
target/scripts/startup/setup.d/saslauthd.sh
Normal file
|
@ -0,0 +1,47 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
function _setup_saslauthd
|
||||
{
|
||||
_log 'debug' 'Setting up SASLAUTHD'
|
||||
|
||||
if [[ ! -f /etc/saslauthd.conf ]]
|
||||
then
|
||||
_log 'trace' 'Creating /etc/saslauthd.conf'
|
||||
cat > /etc/saslauthd.conf << EOF
|
||||
ldap_servers: ${SASLAUTHD_LDAP_SERVER}
|
||||
|
||||
ldap_auth_method: ${SASLAUTHD_LDAP_AUTH_METHOD}
|
||||
ldap_bind_dn: ${SASLAUTHD_LDAP_BIND_DN}
|
||||
ldap_bind_pw: ${SASLAUTHD_LDAP_PASSWORD}
|
||||
|
||||
ldap_search_base: ${SASLAUTHD_LDAP_SEARCH_BASE}
|
||||
ldap_filter: ${SASLAUTHD_LDAP_FILTER}
|
||||
|
||||
ldap_start_tls: ${SASLAUTHD_LDAP_START_TLS}
|
||||
ldap_tls_check_peer: ${SASLAUTHD_LDAP_TLS_CHECK_PEER}
|
||||
|
||||
${SASLAUTHD_LDAP_TLS_CACERT_FILE}
|
||||
${SASLAUTHD_LDAP_TLS_CACERT_DIR}
|
||||
${SASLAUTHD_LDAP_PASSWORD_ATTR}
|
||||
${SASLAUTHD_LDAP_MECH}
|
||||
|
||||
ldap_referrals: yes
|
||||
log_level: 10
|
||||
EOF
|
||||
fi
|
||||
|
||||
sed -i \
|
||||
-e "/^[^#].*smtpd_sasl_type.*/s/^/#/g" \
|
||||
-e "/^[^#].*smtpd_sasl_path.*/s/^/#/g" \
|
||||
/etc/postfix/master.cf
|
||||
|
||||
sed -i \
|
||||
-e "/smtpd_sasl_path =.*/d" \
|
||||
-e "/smtpd_sasl_type =.*/d" \
|
||||
-e "/dovecot_destination_recipient_limit =.*/d" \
|
||||
/etc/postfix/main.cf
|
||||
|
||||
gpasswd -a postfix sasl >/dev/null
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue