diff --git a/8/Dockerfile b/8/Dockerfile index 936e243..b8de0d4 100644 --- a/8/Dockerfile +++ b/8/Dockerfile @@ -84,6 +84,7 @@ RUN set -xe; \ make \ mariadb-client \ mariadb-connector-c \ + msmtp \ nano \ openssh \ openssh-client \ @@ -353,11 +354,13 @@ RUN set -xe; \ "${FILES_DIR}/xdebug" \ /home/www-data/.ssh; \ \ + touch /etc/msmtprc; \ chmod -R 775 "${FILES_DIR}"; \ chown -R wodby:wodby \ "${PHP_INI_DIR}/conf.d" \ /usr/local/etc/php-fpm.d \ /etc/ssmtp/ssmtp.conf \ + /etc/msmtprc \ /home/wodby/.[^.]*; \ \ touch /etc/ssh/sshd_config /etc/gitconfig; \ diff --git a/8/docker-entrypoint.sh b/8/docker-entrypoint.sh index 561a78d..d465a90 100755 --- a/8/docker-entrypoint.sh +++ b/8/docker-entrypoint.sh @@ -79,6 +79,7 @@ process_templates() { _gotpl "ssh_config.tmpl" "${ssh_dir}/config" _gotpl "gitconfig.tmpl" "/etc/gitconfig" _gotpl "ssmtp.conf.tmpl" "/etc/ssmtp/ssmtp.conf" + _gotpl "msmtprc.tmpl" "/etc/msmtprc" } disable_modules() { diff --git a/8/templates/msmtprc.tmpl b/8/templates/msmtprc.tmpl new file mode 100644 index 0000000..08bf7f5 --- /dev/null +++ b/8/templates/msmtprc.tmpl @@ -0,0 +1,11 @@ +defaults +port {{ getenv "MSMTP_PORT" "25" }} +tls {{ getenv "MSMTP_TLS" "off" }} +{{-if getenv "MSMTP_LOG" }} +logfile {{ getenv "MSMTP_LOGFILE" "/proc/self/fd/2" }} +{{-end }} + +account default +auth {{ getenv "MSMTP_AUTH" "off" }} +host {{ getenv "MSMTP_HOST" "opensmtpd" }} +add_missing_date_header {{ getenv "MSMTP_ADD_MISSING_DATE_HEADER" "on" }} diff --git a/README.md b/README.md index bae8b97..94cf3f0 100644 --- a/README.md +++ b/README.md @@ -188,6 +188,13 @@ The default configuration not recommended for use for production environment: | `SSMTP_MAILHUB` | `opensmtpd:25` | | `SSMTP_FROM_LINE_OVERRIDE` | `Yes` | | `SSMTP_USE_TLS` | `No` | +| `MSMTP_PORT` | `25` | +| `MSMTP_TLS` | `off` | +| `MSMTP_LOG` | | +| `MSMTP_LOGFILE` | `/proc/self/fd/2` | +| `MSMTP_AUTH` | `off` | +| `MSMTP_HOST` | `opensmtpd` | +| `MSMTP_ADD_MISSING_DATE_HEADER` | `on` | ## Build arguments