Skip to content

Commit ba3e21e

Browse files
committed
Replace the admin password in saslauhd.conf
1 parent d15edcf commit ba3e21e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docker/docker-entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set -eu
1414
ulimit -n $LDAP_NOFILE
1515

1616
echo 'Replacing values with ENV values'
17+
sed -i "s|{{ LDAP_ADMIN_PASSWORD }}|${LDAP_ADMIN_PASSWORD}|" /etc/saslauthd.conf
1718
sed -i "s|{{ LDAP_AUTH_BASE_DN }}|${LDAP_AUTH_BASE_DN}|" /etc/saslauthd.conf
1819
sed -i "s|{{ LDAP_BASE_DN }}|${LDAP_BASE_DN}|" /etc/saslauthd.conf
1920
sed -i "s|{{ LDAP_AUTH_BASE_DN }}|${LDAP_AUTH_BASE_DN}|" /etc/openldap/slapd.conf
@@ -26,6 +27,7 @@ echo 'Checking if replacement worked'
2627
set -x
2728
grep -q -F "ldap_bind_dn: cn=admin,${LDAP_BASE_DN}" /etc/saslauthd.conf
2829
grep -q -F "ldap_search_base: ${LDAP_AUTH_BASE_DN}" /etc/saslauthd.conf
30+
grep -q -F "ldap_bind_pw: ${LDAP_ADMIN_PASSWORD}" /etc/saslauthd.conf
2931
grep -q -F ",${LDAP_AUTH_BASE_DN}" /etc/openldap/slapd.conf
3032
grep -q -F "suffix \"${LDAP_BASE_DN}\"" /etc/openldap/slapd.conf
3133
grep -q -F "${LDAP_CONFIG_PASSWORD}" /etc/openldap/slapd.conf
@@ -35,3 +37,4 @@ set +x
3537

3638
echo 'Starting...'
3739
horust --unsuccessful-exit-finished-failed
40+
ldap_bind_pw: {{ LDAP_ADMIN_PASSWORD }}

docker/saslauthd.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ldap_version: 3
55
ldap_auth_method: bind
66
ldap_mech: SRP
77
ldap_bind_dn: cn=admin,{{ LDAP_BASE_DN }}
8-
ldap_bind_pw: admin
8+
ldap_bind_pw: {{ LDAP_ADMIN_PASSWORD }}
99
ldap_search_base: {{ LDAP_AUTH_BASE_DN }}
1010
ldap_scope: sub
1111
ldap_filter: (&(mail=%u@%r)(objectclass=PostfixBookMailAccount)(mailEnabled=TRUE))

0 commit comments

Comments
 (0)