From e6dc75336566da143522fd7e2708513957bb64a0 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Sun, 27 Sep 2020 21:27:08 +0200 Subject: [PATCH] Improve email set-up --- README.md | 9 +++++++++ compose.mailrelay.yml | 14 +++++++------- entrypoint.mailrelay.sh.tmpl | 2 +- msmtp.conf.tmpl | 2 +- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6d2ab56..d412698 100644 --- a/README.md +++ b/README.md @@ -47,5 +47,14 @@ _(Only tested using subdomains)_ 2. `direnv allow` 3. `abra deploy` +## Email + +1. Deploy `postfix-relay` +2. Edit `.envrc` and uncomment the email lines; change `MAIL_FROM` to make sure + the domain is the same as `postfix-relay`'s `$DOMAIN` or in its + `$EXTRA_SENDER_DOMAINS` +3. `direnv allow` (or `source .envrc`) +7. `abra deploy` + [abra]: https://git.autonomic.zone/autonomic-cooperative/abra [compose-traefik]: https://git.autonomic.zone/compose-stacks/traefik diff --git a/compose.mailrelay.yml b/compose.mailrelay.yml index 81725a1..32181eb 100644 --- a/compose.mailrelay.yml +++ b/compose.mailrelay.yml @@ -3,17 +3,17 @@ version: "3.8" services: wordpress: - entrypoint: /docker-entrypoint2.sh + entrypoint: /docker-entrypoint.sh environment: - SMTP_HOST=${SMTP_HOST} + - MAIL_FROM=${MAIL_FROM} networks: - mail configs: - - source: entrypoint_mailrelay_conf - target: /docker-entrypoint2.sh - mode: 0555 - source: mstmp_conf target: /etc/msmtprc + - source: entrypoint + target: /etc/msmtprc mode: 0555 networks: @@ -25,7 +25,7 @@ configs: name: ${STACK_NAME}_mstmp_conf_${MSMTP_CONF_VERSION} file: msmtp.conf.tmpl template_driver: golang - entrypoint_mailrelay_conf: - name: ${STACK_NAME}_entrypoint_mailrelay_${ENTRYPOINT_MAILRELAY_CONF_VERSION} - file: entrypoint.mailrelay.sh.tmpl + entrypoint_conf: + name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION} + file: entrypoint.sh.tmpl template_driver: golang diff --git a/entrypoint.mailrelay.sh.tmpl b/entrypoint.mailrelay.sh.tmpl index e65f652..c681ce9 100644 --- a/entrypoint.mailrelay.sh.tmpl +++ b/entrypoint.mailrelay.sh.tmpl @@ -2,7 +2,7 @@ apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y msmtp && rm -rf /var/lib/apt/lists/* -echo "sendmail_path = /usr/bin/msmtp -t -i" >> /usr/local/etc/php/conf.d/sendmail.ini +echo "sendmail_path = /usr/bin/msmtp -t -i" > /usr/local/etc/php/conf.d/sendmail.ini # Upstream ENTRYPOINT # https://github.com/docker-library/wordpress/blob/master/php7.4/apache/Dockerfile#L120 diff --git a/msmtp.conf.tmpl b/msmtp.conf.tmpl index 991a6b9..f240920 100644 --- a/msmtp.conf.tmpl +++ b/msmtp.conf.tmpl @@ -1,3 +1,3 @@ account default host {{ env "SMTP_HOST" }} -auto_from on +from {{ env "MAIL_FROM" }}