From acae4bc5a407e16604a94565fd41147d1a181397 Mon Sep 17 00:00:00 2001 From: Torben Nehmer Date: Thu, 11 Jun 2020 17:34:00 +0200 Subject: [PATCH] Switched to msmtp ssmtp is not available in buster, so we wouldn't be able to send mails. Switched to msmtp, which serves the same purpose. --- Dockerfile | 2 +- build-rootfs.sh | 10 ++++++++-- src/mail.ini | 2 +- src/msmtprc | 10 ++++++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/msmtprc diff --git a/Dockerfile b/Dockerfile index fd502a7..b647e18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN set -ex; \ apt-get update; \ \ apt-get install -y --no-install-recommends \ - ssmtp \ + msmtp \ ; \ \ rm -rf /var/lib/apt/lists/* ;\ diff --git a/build-rootfs.sh b/build-rootfs.sh index 95bcfac..bb4259c 100755 --- a/build-rootfs.sh +++ b/build-rootfs.sh @@ -3,6 +3,7 @@ set -ex # Configuration options you usually edit go here +CONTAINER_MSMTPCONFDIR=/etc CONTAINER_SSMTPCONFDIR=/etc/ssmtp CONTAINER_PHP_CONFD=/usr/local/etc/php/conf.d @@ -14,6 +15,7 @@ BUILDDIR=$(pwd)/build SCRIPTS_SRC=${SRCDIR}/scripts ROOTFSTREE=${TMPDIR}/tree ROOTFSFILE=${BUILDDIR}/rootfs.tar.gz +MSMTPRC_DST=${ROOTFSTREE}${CONTAINER_MSMTPCONFDIR} SSMTPCONF_DST=${ROOTFSTREE}${CONTAINER_SSMTPCONFDIR} PHP_CONFD_DST=${ROOTFSTREE}${CONTAINER_PHP_CONFD} @@ -31,8 +33,12 @@ mkdir ${BUILDDIR} #### Do the work. # Create SSMTP config file -mkdir -p ${SSMTPCONF_DST} -cp ${SRCDIR}/ssmtp.conf ${SSMTPCONF_DST}/ssmtp.conf +#mkdir -p ${SSMTPCONF_DST} +#cp ${SRCDIR}/ssmtp.conf ${SSMTPCONF_DST}/ssmtp.conf + +# Create MSMTP config file (SSMTP is currently unavailble in Debian Buster) +mkdir -p ${MSMTPRC_DST} +cp ${SRCDIR}/msmtprc ${MSMTPRC_DST}/msmtprc # Setup PHP mkdir -p ${PHP_CONFD_DST} diff --git a/src/mail.ini b/src/mail.ini index a0c5ff4..7149cd2 100644 --- a/src/mail.ini +++ b/src/mail.ini @@ -1 +1 @@ -sendmail_path = "/usr/sbin/ssmtp -t -i" +sendmail_path = "/usr/bin/msmtp -t" diff --git a/src/msmtprc b/src/msmtprc new file mode 100644 index 0000000..278f366 --- /dev/null +++ b/src/msmtprc @@ -0,0 +1,10 @@ +account default + +host nathan.nehmer.net +tls on +tls_starttls on +domain docker.nehmer.net + +from postmaster@nehmer.net +maildomain nehmer.net +