mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-02 21:44:51 +02:00
fix!: Allow protocol in SASLAUTHD_LDAP_SERVER & adjust SASLAUTHD_LDAP_ default values (#1989)
* fix: make sure the SASLAUTHD_LDAP_HOST/PROTO logic makes sense and use LDAP_SERVER_HOST as a fallback (#1983) * chore(docs): document changes to LDAP/SASLAUTHD as of #1983 * fix!: apply default value modifications suggested in #1983 https://github.com/docker-mailserver/docker-mailserver/issues/1983#issuecomment-844848224 * chore(test): Test SASLAUTHD_LDAP_SERVER with protocol and ..._SSL=0, as well as with default bind credentials Note that there are currently no regression tests for this as there's only one setup_file, so that would require big changes to the testing methodology. * refactor!: completely remove SASLAUTHD_LDAP_SSL and SASLAUTHD_LDAP_PROTO Co-authored-by: Georg Lauterbach <44545919+aendeavor@users.noreply.github.com> Co-authored-by: Frederic Werner <20406381+wernerfred@users.noreply.github.com>
This commit is contained in:
parent
dd723f53ee
commit
66bc157c1d
6 changed files with 23 additions and 38 deletions
|
@ -618,13 +618,16 @@ function _setup_saslauthd
|
|||
|
||||
# checking env vars and setting defaults
|
||||
[[ -z ${SASLAUTHD_MECHANISMS:-} ]] && SASLAUTHD_MECHANISMS=pam
|
||||
[[ ${SASLAUTHD_MECHANISMS:-} == ldap ]] && [[ -z ${SASLAUTHD_LDAP_SEARCH_BASE} ]] && SASLAUTHD_MECHANISMS=pam
|
||||
[[ -z ${SASLAUTHD_LDAP_SERVER} ]] && SASLAUTHD_LDAP_SERVER=localhost
|
||||
[[ -z ${SASLAUTHD_LDAP_SERVER} ]] && SASLAUTHD_LDAP_SERVER="${LDAP_SERVER_HOST}"
|
||||
[[ -z ${SASLAUTHD_LDAP_FILTER} ]] && SASLAUTHD_LDAP_FILTER='(&(uniqueIdentifier=%u)(mailEnabled=TRUE))'
|
||||
|
||||
if [[ -z ${SASLAUTHD_LDAP_SSL} ]] || [[ ${SASLAUTHD_LDAP_SSL} -eq 0 ]]
|
||||
[[ -z ${SASLAUTHD_LDAP_BIND_DN} ]] && SASLAUTHD_LDAP_BIND_DN="${LDAP_BIND_DN}"
|
||||
[[ -z ${SASLAUTHD_LDAP_PASSWORD} ]] && SASLAUTHD_LDAP_PASSWORD="${LDAP_BIND_PW}"
|
||||
[[ -z ${SASLAUTHD_LDAP_SEARCH_BASE} ]] && SASLAUTHD_LDAP_SEARCH_BASE="${LDAP_SEARCH_BASE}"
|
||||
|
||||
if [[ "${SASLAUTHD_LDAP_SERVER}" != *'://'* ]]
|
||||
then
|
||||
SASLAUTHD_LDAP_PROTO='ldap://' || SASLAUTHD_LDAP_PROTO='ldaps://'
|
||||
SASLAUTHD_LDAP_SERVER="ldap://${SASLAUTHD_LDAP_SERVER}"
|
||||
fi
|
||||
|
||||
[[ -z ${SASLAUTHD_LDAP_START_TLS} ]] && SASLAUTHD_LDAP_START_TLS=no
|
||||
|
@ -663,7 +666,7 @@ function _setup_saslauthd
|
|||
then
|
||||
_notify 'inf' 'Creating /etc/saslauthd.conf'
|
||||
cat > /etc/saslauthd.conf << EOF
|
||||
ldap_servers: ${SASLAUTHD_LDAP_PROTO}${SASLAUTHD_LDAP_SERVER}
|
||||
ldap_servers: ${SASLAUTHD_LDAP_SERVER}
|
||||
|
||||
ldap_auth_method: ${SASLAUTHD_LDAP_AUTH_METHOD}
|
||||
ldap_bind_dn: ${SASLAUTHD_LDAP_BIND_DN}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue