From a2d4f6211885308019330b2a238a7bccb8f1476f Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Sun, 21 May 2017 16:56:48 +0200 Subject: [PATCH] Fixing configuration when using LDAP --- target/start-mailserver.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/target/start-mailserver.sh b/target/start-mailserver.sh index 53d2ae64..94bddb6c 100644 --- a/target/start-mailserver.sh +++ b/target/start-mailserver.sh @@ -549,10 +549,16 @@ function _setup_dovecot_local_user() { echo ${domain} >> /tmp/vhost.tmp done else - notify 'fatal' "'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created." - notify 'fatal' "You need at least 1 email account to start the server." - defunc + notify 'inf' "'config/docker-mailserver/postfix-accounts.cf' is not provided. No mail account created." fi + + if [[ ! $(grep '@' /tmp/docker-mailserver/postfix-accounts.cf | grep '|') ]]; then + if [ $ENABLE_LDAP -eq 0 ]; then + notify 'fatal' "Unless using LDAP, you need at least 1 email account to start the server." + defunc + fi + fi + } function _setup_ldap() {