From ece8a5d7e499f99c2171edbcf5e4dde455541912 Mon Sep 17 00:00:00 2001 From: Sebastian Rakel Date: Wed, 29 Aug 2018 10:00:54 +0200 Subject: Use msmtp to send mail in docker container To send mails in the docker container we need to configure php to use a smtp client and provide smtp credentials to the docker container --- docker/filebin_starter.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'docker/filebin_starter.sh') diff --git a/docker/filebin_starter.sh b/docker/filebin_starter.sh index 7f0b70d85..66f9a8b03 100755 --- a/docker/filebin_starter.sh +++ b/docker/filebin_starter.sh @@ -2,12 +2,29 @@ #set -euo pipefail +function set_mail_config() { +cat < ${FILEBIN_HOME_DIR}/msmtprc +account filebinmail +tls on +tls_certcheck off +auth on +host ${FB_SMTP_HOST} +port ${FB_SMTP_PORT} +user ${FB_SMTP_USER} +from ${FB_SMTP_USER} +password ${FB_SMTP_PASSWORD} +EOF + +chmod 600 ${FILEBIN_HOME_DIR}/msmtprc +} + function set_config() { FB_ENCRYPTION_KEY=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32` cat <${FILEBIN_DIR}/application/config/config-local.php