Spotter-VM/postfix.sh

19 lines
528 B
Bash
Raw Normal View History

2018-01-15 20:05:33 +01:00
#!/bin/sh
SOURCE_DIR=$(realpath $(dirname "${0}"))/postfix
2018-01-23 18:18:35 +01:00
2018-01-15 20:05:33 +01:00
# Build Docker container
docker build -t postfix ${SOURCE_DIR}
# Copy existing config files into persistent storage
mkdir -p /srv/postfix/conf /srv/postfix/data
docker run --rm -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
2018-01-15 20:05:33 +01:00
service postfix start