Spotter-VM/postfix.sh

19 lines
578 B
Bash
Raw Normal View History

2018-01-15 20:05:33 +01:00
#!/bin/sh
SOURCE_DIR=$(realpath $(dirname "${0}"))/postfix
# Build Docker container
docker build -t postfix ${SOURCE_DIR}
# Copy existing config files into persistent storage
mkdir -p /srv/postfix/conf /srv/postfix/data
chown -R 587:587 /srv/postfix/data
2018-01-15 21:51:15 +01:00
docker run --rm -h postfix -v /srv/postfix/conf:/mnt/conf postfix cp -rp /etc/postfix/. /mnt/conf
2018-01-15 20:05:33 +01:00
# Configure postfix
cp ${SOURCE_DIR}/srv/postfix/conf/main.cf /srv/postfix/conf/main.cf
# Configure postfix service
cp ${SOURCE_DIR}/etc/init.d/postfix /etc/init.d/postfix
rc-update add postfix boot
service postfix start