diff --git a/target/features/ldap/saslauthd.base b/target/features/ldap/saslauthd.base index 4dddd75f..4d92c33e 100644 --- a/target/features/ldap/saslauthd.base +++ b/target/features/ldap/saslauthd.base @@ -1,2 +1,6 @@ +ldap_bind_dn: ${BIND_DN} +ldap_bind_pw: ${BIND_PW} +ldap_servers: ${SERVER_HOST} +ldap_search_base: ${SEARCH_BASE} ldap_filter: (&(uniqueIdentifier=%u)(mailEnabled=TRUE)) ldap_referrals: yes diff --git a/target/scripts/startup/setup.d/saslauthd.sh b/target/scripts/startup/setup.d/saslauthd.sh index 524a8bb5..c1c23e4c 100644 --- a/target/scripts/startup/setup.d/saslauthd.sh +++ b/target/scripts/startup/setup.d/saslauthd.sh @@ -26,17 +26,12 @@ function _setup_saslauthd() { gpasswd -a postfix sasl >/dev/null } +# Generates a config from an ENV template while layering several other sources +# into a single temporary file, used as input into `_cleanse_config` which +# prepares the final output config. function _create_config_saslauthd() { - local SASLAUTHD_LDAP_SERVER=${SASLAUTHD_LDAP_SERVER:=${LDAP_SERVER_HOST}} - local SASLAUTHD_LDAP_BIND_DN=${SASLAUTHD_LDAP_BIND_DN:=${LDAP_BIND_DN}} - local SASLAUTHD_LDAP_PASSWORD=${SASLAUTHD_LDAP_PASSWORD:=${LDAP_BIND_PW}} - local SASLAUTHD_LDAP_SEARCH_BASE=${SASLAUTHD_LDAP_SEARCH_BASE:=${LDAP_SEARCH_BASE}} - - # Generates a config from an ENV template while layering several other sources - # into a single temporary file, used as input into `_cleanse_config` which - # prepares the final output config. _cleanse_config ':' <(cat 2>/dev/null \ - /etc/dms/ldap/saslauthd.base \ + <(_template_with_env 'LDAP_' /etc/dms/ldap/saslauthd.base) \ /tmp/docker-mailserver/ldap/saslauthd.conf \ <(_template_with_env 'SASLAUTHD_' /etc/dms/ldap/saslauthd.tmpl) \ ) > /etc/saslauthd.conf