feat: Add message_size_limit option (#86)

* feat: Add MESSAGE_SIZE_LIMIT configuration option (PR #86)
This commit is contained in:
Nasser 2022-06-21 00:38:09 +03:00 committed by GitHub
parent 1426f26546
commit ceab4779d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -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=

View file

@ -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" \

6
run.sh
View file

@ -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