Skip to content

Commit

Permalink
feat: Add message_size_limit option (#86)
Browse files Browse the repository at this point in the history
* feat: Add MESSAGE_SIZE_LIMIT configuration option (PR #86)
  • Loading branch information
nassoor authored Jun 20, 2022
1 parent 1426f26 commit ceab477
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 @@ -37,3 +37,6 @@

# Optional: This will disable (no) or enable (yes) the use of SMTPUTF8
#SMTPUTF8_ENABLE=no

# Optional: This will use allow you to set a custom $message_size_limit value. Default is 10240000.
#MESSAGE_SIZE_LIMIT=
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ The following env variable(s) are optional.

* `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`.

* `MESSAGE_SIZE_LIMIT` This will change the default limit of 10240000 bytes (10MB).

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 @@ -99,6 +99,12 @@ if [ ! -z "${OVERWRITE_FROM}" ]; then
echo "Setting configuration option OVERWRITE_FROM with value: ${OVERWRITE_FROM}"
fi

# Set message_size_limit
if [ ! -z "${MESSAGE_SIZE_LIMIT}" ]; then
postconf -e "message_size_limit = ${MESSAGE_SIZE_LIMIT}"
echo "Setting configuration option message_size_limit with value: ${MESSAGE_SIZE_LIMIT}"
fi

#Start services

# If host mounting /var/spool/postfix, we need to delete old pid file before
Expand Down

0 comments on commit ceab477

Please sign in to comment.