From 1f5e2c8f466aa963a8753796bcc51c53aa8a33b0 Mon Sep 17 00:00:00 2001 From: Benjamin Dabelow <2276720+bdabelow@users.noreply.github.com> Date: Fri, 15 Nov 2024 22:56:17 +0100 Subject: [PATCH] Support allow_from_override setting --- README.md | 1 + rootfs/etc/cont-init.d/02-config.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 21509b5..ecdeec9 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ linux/s390x * `SMTP_PASSWORD`: Set the password for authentication. Authentication must be activated with the `SMTP_AUTH` env var. * `SMTP_DOMAIN`: Argument of the `SMTP EHLO` command (default `localhost`) * `SMTP_FROM`: Set the envelope-from address. Supported substitution patterns can be found [here](https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode). +* `SMTP_ALLOW_FROM_OVERRIDE`: Allow configured envelope-from address to be overriden by actual SMTP MAIL FROM . Can be [`on` or `off`](https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode) (default `on`) * `SMTP_SET_FROM_HEADER`: When to set a From header. Can be [`auto`, `on` or `off`](https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode) (default `auto`) * `SMTP_SET_DATE_HEADER`: When to set a Date header. Can be [`auto` or `off`](https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode) (default `auto`) * `SMTP_REMOVE_BCC_HEADERS`: Controls whether to remove Bcc headers. Can be [`on` or `off`](https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode) (default `on`) diff --git a/rootfs/etc/cont-init.d/02-config.sh b/rootfs/etc/cont-init.d/02-config.sh index afcce8b..c2eeca3 100644 --- a/rootfs/etc/cont-init.d/02-config.sh +++ b/rootfs/etc/cont-init.d/02-config.sh @@ -71,6 +71,7 @@ if [ -n "$SMTP_USER" ]; then echo "user $SMTP_USER" >> /etc/ if [ -n "$SMTP_PASSWORD" ]; then echo "password $SMTP_PASSWORD" >> /etc/msmtprc; fi if [ -n "$SMTP_DOMAIN" ]; then echo "domain $SMTP_DOMAIN" >> /etc/msmtprc; fi if [ -n "$SMTP_FROM" ]; then echo "from $SMTP_FROM" >> /etc/msmtprc; fi +if [ -n "$SMTP_ALLOW_FROM_OVERRIDE" ]; then echo "allow_from_override $SMTP_ALLOW_FROM_OVERRIDE" >> /etc/msmtprc; fi if [ -n "$SMTP_SET_FROM_HEADER" ]; then echo "set_from_header $SMTP_SET_FROM_HEADER" >> /etc/msmtprc; fi if [ -n "$SMTP_SET_DATE_HEADER" ]; then echo "set_date_header $SMTP_SET_DATE_HEADER" >> /etc/msmtprc; fi if [ -n "$SMTP_REMOVE_BCC_HEADERS" ]; then echo "remove_bcc_headers $SMTP_REMOVE_BCC_HEADERS" >> /etc/msmtprc; fi