diff --git a/README.md b/README.md index 66337e5a..a34efd12 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,9 @@ Example: * *6.31* (default) => add 'spam detected' headers at that level * SA_KILL * *6.31* (default) => triggers spam evasive actions) +* SASL_PASSWORD + * *empty* (default) => No sasl_passwd will be created + * *string* => A /etc/postfix/sasl_passwd will be created with that content and postmap will be run on it Please read [how the container starts](https://github.com/tomav/docker-mailserver/blob/master/start-mailserver.sh) to understand what's expected. diff --git a/start-mailserver.sh b/start-mailserver.sh index 8756643a..1af17c30 100644 --- a/start-mailserver.sh +++ b/start-mailserver.sh @@ -182,6 +182,17 @@ else echo "==> Warning: '/tmp/postfix/main.cf' is not provided. No extra postfix settings loaded." fi +if [ ! -z "$SASL_PASSWD" ]; then + echo "$SASL_PASSWD" > /etc/postfix/sasl_passwd + postmap hash:/etc/postfix/sasl_passwd + rm /etc/postfix/sasl_passwd + chown root:root /etc/postfix/sasl_passwd.db + chmod 0600 /etc/postfix/sasl_passwd.db + echo "Loaded SASL_PASSWORD" +else + echo "==> Warning: 'SASL_PASSWORD' is not provided. /etc/postfix/sasl_passwd not created." +fi + echo "Fixing permissions" chown -R 5000:5000 /var/mail mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav