diff --git a/dockerinit.sh b/dockerinit.sh index 093e732..06cc4ff 100644 --- a/dockerinit.sh +++ b/dockerinit.sh @@ -46,7 +46,7 @@ if [[ ! -f ".configured" ]]; then : ${IREDAPD_DB_PASSWD:=`eval /dev/null || head -c 20)`} : ${FAIL2BAN_DB_PASSWD:=`eval /dev/null || head -c 20)`} : ${USE_SYSTEMD:=NO} - +: ${MAILNAME:=`hostname -f`} if [[ X"${MYSQLEXIST}" == X'YES' || X"${MYSQLEXIST}" == X'yes' ]]; then : ${USE_EXISTING_MYSQL:=YES} @@ -61,6 +61,12 @@ if [[ ! -f ".configured" ]]; then . /lib/lsb/init-functions + + +cat < /etc/mailname +$MAILNAME +EOF + echo '>create initial config file' cat < /iredmail/config @@ -293,7 +299,7 @@ EOF } - if [[ X"${EXTERNAL_LDAP_USE}" == X'YES' || X"${EXTERNAL_LDAP_USE}" == X'yes' ]]; then + if [[ X"${LDAP_EXTERNAL_USE}" == X'YES' || X"${LDAP_EXTERNAL_USE}" == X'yes' ]]; then external_ldap_config fi @@ -302,26 +308,30 @@ EOF else - if [[ X"${MYSQLEXIST}" != X'YES' || X"${MYSQLEXIST}" != X'yes' ]]; then - service mysql start - fi - service iredapd start - service dovecot start - service clamav_clamd start - service clamav_freshclam start - service nginx start - service php7.2-fpm start - service amavisd start - # Start syslog-ng /usr/sbin/syslog-ng -F --no-caps & - service postfix start - service mlmmjadmin_enable start - service uwsgi start - if [[ X"${EXTERNAL_LDAP_USE}" != X'YES' || X"${EXTERNAL_LDAP_USE}" != X'yes' ]]; then + if [[ X"${MYSQLEXIST}" != X'YES' || X"${MYSQLEXIST}" != X'yes' ]]; then + service mysql start + fi + + service dovecot start + service nginx start + service php7.2-fpm start + +# Start postfix + start-stop-daemon --start --exec /usr/sbin/postmulti -- -i - -x /usr/sbin/postfix quiet-quick-start + + service clamav-daemon start + service clamav-freshclam start + service spamassasin start + service amavis start + service mlmmjadmin_enable start + service uwsgi start + + if [[ X"${LDAP_EXTERNAL_USE}" != X'YES' || X"${LDAP_EXTERNAL_USE}" != X'yes' ]]; then service slapd start service iredapd start fi