Substitute variables properly in dovecot configuration

master
Pierre Jaury 9 years ago
parent 988f16f3a4
commit b0a1848bb7

@ -1,8 +1,13 @@
#!/bin/sh #!/bin/bash
# Substitute configuration
for VARIABLE in `env | cut -f1 -d=`; do
sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/dovecot/*.conf
done
# Fix permissions # Fix permissions
chown -R mail:mail /mail chown -R mail:mail /mail
chown -R mail:mail /var/lib/dovecot chown -R mail:mail /var/lib/dovecot
# Run dovecot # Run dovecot
exec /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F exec /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F

Loading…
Cancel
Save