From b0a1848bb79ae8ff3c4a0b3e50fb39bb5660f2e9 Mon Sep 17 00:00:00 2001 From: Pierre Jaury Date: Sun, 29 May 2016 15:55:36 +0200 Subject: [PATCH] Substitute variables properly in dovecot configuration --- dovecot/start.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dovecot/start.sh b/dovecot/start.sh index 8912dfe1..7cfd26a0 100755 --- a/dovecot/start.sh +++ b/dovecot/start.sh @@ -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 chown -R mail:mail /mail -chown -R mail:mail /var/lib/dovecot +chown -R mail:mail /var/lib/dovecot # Run dovecot exec /usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F