Add SASL_PASSWD environment variable to configure relay authentication

This commit is contained in:
Robert Dolca 2016-02-20 02:17:14 +00:00
parent 0e2ef0f8c2
commit d36ecaa2c0
2 changed files with 14 additions and 0 deletions

View file

@ -94,6 +94,9 @@ Example:
* *6.31* (default) => add 'spam detected' headers at that level * *6.31* (default) => add 'spam detected' headers at that level
* SA_KILL * SA_KILL
* *6.31* (default) => triggers spam evasive actions) * *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. Please read [how the container starts](https://github.com/tomav/docker-mailserver/blob/master/start-mailserver.sh) to understand what's expected.

View file

@ -182,6 +182,17 @@ else
echo "==> Warning: '/tmp/postfix/main.cf' is not provided. No extra postfix settings loaded." echo "==> Warning: '/tmp/postfix/main.cf' is not provided. No extra postfix settings loaded."
fi 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" echo "Fixing permissions"
chown -R 5000:5000 /var/mail chown -R 5000:5000 /var/mail
mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav mkdir -p /var/log/clamav && chown -R clamav:root /var/log/clamav