mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-24 04:34:50 +02:00
change if style (#3361)
This commit is contained in:
parent
0e592aa911
commit
cf74127f78
58 changed files with 297 additions and 594 deletions
|
@ -8,8 +8,7 @@ function _setup_ldap
|
|||
for i in 'users' 'groups' 'aliases' 'domains'
|
||||
do
|
||||
local FPATH="/tmp/docker-mailserver/ldap-${i}.cf"
|
||||
if [[ -f ${FPATH} ]]
|
||||
then
|
||||
if [[ -f ${FPATH} ]]; then
|
||||
cp "${FPATH}" "/etc/postfix/ldap-${i}.cf"
|
||||
fi
|
||||
done
|
||||
|
@ -46,8 +45,7 @@ function _setup_ldap
|
|||
|
||||
# Add protocol to DOVECOT_URIS so that we can use dovecot's "uris" option:
|
||||
# https://doc.dovecot.org/configuration_manual/authentication/ldap/
|
||||
if [[ ${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]} != *'://'* ]]
|
||||
then
|
||||
if [[ ${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]} != *'://'* ]]; then
|
||||
DOVECOT_LDAP_MAPPING['DOVECOT_URIS']="ldap://${DOVECOT_LDAP_MAPPING["DOVECOT_URIS"]}"
|
||||
fi
|
||||
|
||||
|
@ -68,22 +66,19 @@ function _setup_ldap
|
|||
|
||||
_log 'trace' "Configuring LDAP"
|
||||
|
||||
if [[ -f /etc/postfix/ldap-users.cf ]]
|
||||
then
|
||||
if [[ -f /etc/postfix/ldap-users.cf ]]; then
|
||||
postconf 'virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf'
|
||||
else
|
||||
_log 'warn' "'/etc/postfix/ldap-users.cf' not found"
|
||||
fi
|
||||
|
||||
if [[ -f /etc/postfix/ldap-domains.cf ]]
|
||||
then
|
||||
if [[ -f /etc/postfix/ldap-domains.cf ]]; then
|
||||
postconf 'virtual_mailbox_domains = /etc/postfix/vhost, ldap:/etc/postfix/ldap-domains.cf'
|
||||
else
|
||||
_log 'warn' "'/etc/postfix/ldap-domains.cf' not found"
|
||||
fi
|
||||
|
||||
if [[ -f /etc/postfix/ldap-aliases.cf ]] && [[ -f /etc/postfix/ldap-groups.cf ]]
|
||||
then
|
||||
if [[ -f /etc/postfix/ldap-aliases.cf ]] && [[ -f /etc/postfix/ldap-groups.cf ]]; then
|
||||
postconf 'virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-groups.cf'
|
||||
else
|
||||
_log 'warn' "'/etc/postfix/ldap-aliases.cf' and / or '/etc/postfix/ldap-groups.cf' not found"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue