Skip to content

Commit

Permalink
feat: Allow disabling SMTPUTF8
Browse files Browse the repository at this point in the history
  • Loading branch information
envy authored and juanluisbaptiste committed Apr 21, 2022
1 parent f280c00 commit a80ceca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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" \
Expand Down
6 changes: 6 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a80ceca

Please sign in to comment.