2016-03-02 22:25:56 +02:00
|
|
|
#!/bin/bash
|
2016-02-24 08:44:49 +02:00
|
|
|
|
2016-03-02 22:25:56 +02:00
|
|
|
# Substitute configuration
|
|
|
|
for VARIABLE in `env | cut -f1 -d=`; do
|
2016-03-13 18:45:39 +02:00
|
|
|
sed -i "s={{ $VARIABLE }}=${!VARIABLE}=g" /etc/postfix/*.cf
|
2016-03-02 22:25:56 +02:00
|
|
|
done
|
|
|
|
|
2016-08-01 10:29:15 +02:00
|
|
|
# Override Postfix configuration
|
|
|
|
if [ -f /config/main.cf ]; then
|
|
|
|
while read line; do
|
|
|
|
postconf -e "$line"
|
|
|
|
done < /config/main.cf
|
|
|
|
echo "Loaded 'config/main.cf'"
|
|
|
|
else
|
|
|
|
echo "No extra postfix settings loaded because optional '/config/main.cf' not provided."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Include table-map files
|
|
|
|
if [ "$(ls -A /config/*.map)" ]; then
|
|
|
|
cp /config/*.map /etc/postfix/
|
|
|
|
postmap /etc/postfix/*.map
|
|
|
|
rm /etc/postfix/*.map
|
|
|
|
chown root:root /etc/postfix/*.db
|
|
|
|
chmod 0600 /etc/postfix/*.db
|
|
|
|
fi
|
|
|
|
|
2016-03-02 22:25:56 +02:00
|
|
|
# Actually run Postfix
|
2016-03-20 16:37:15 +02:00
|
|
|
rm -f /var/run/rsyslogd.pid
|
2016-02-24 08:44:49 +02:00
|
|
|
/usr/lib/postfix/master &
|
|
|
|
rsyslogd -n
|