diff --git a/.env.example b/.env.example index 8af3c2f..0099c2b 100644 --- a/.env.example +++ b/.env.example @@ -34,3 +34,6 @@ # Optional: This will output the subject line of messages in the log. #LOG_SUBJECT=yes + +# Optional: This will disable (no) or enable (yes) the use of SMTPUTF8 +#SMTPUTF8_ENABLE=no diff --git a/README.md b/README.md index d44a446..bb12228 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,8 @@ The following env variable(s) are optional. * `LOG_SUBJECT` This will output the subject line of messages in the log. +* `SMTPUTF8_ENABLE` This will enable (default) or disable support for SMTPUTF8. Valid values are `no` to disable and `yes` to enable. Not setting this variable will use the postfix default, which is `yes`. + To use this container from anywhere, the 25 port or the one specified by `SMTP_PORT` needs to be exposed to the docker host server: docker run -d --name postfix -p "25:25" \ diff --git a/run.sh b/run.sh index 934c2cd..3448ac0 100644 --- a/run.sh +++ b/run.sh @@ -86,6 +86,12 @@ if [ ! -z "${SMTP_NETWORKS}" ]; then fi add_config_value "mynetworks" "${nets}" +# Set SMTPUTF8 +if [ ! -z "${SMTPUTF8_ENABLE}" ]; then + postconf -e "smtputf8_enable = ${SMTPUTF8_ENABLE}" + echo "Setting configuration option smtputf8_enable with value: ${SMTPUTF8_ENABLE}" +fi + if [ ! -z "${OVERWRITE_FROM}" ]; then echo -e "/^From:.*$/ REPLACE From: $OVERWRITE_FROM" > /etc/postfix/smtp_header_checks postmap /etc/postfix/smtp_header_checks