2022-04-13 15:57:46 +08:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2023-10-27 16:31:10 +08:00
|
|
|
if [ -f /etc/os-release ]; then
|
|
|
|
. /etc/os-release
|
|
|
|
fi
|
2022-04-13 15:57:46 +08:00
|
|
|
|
|
|
|
do_alpine() {
|
2022-04-13 18:51:39 +08:00
|
|
|
apk update
|
2022-04-13 15:57:46 +08:00
|
|
|
apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm
|
|
|
|
apk add postfix
|
|
|
|
apk add opendkim
|
2023-10-27 23:44:20 +08:00
|
|
|
apk add --upgrade ca-certificates tzdata supervisor rsyslog musl musl-utils bash opendkim-utils libcurl jsoncpp lmdb logrotate netcat-openbsd
|
2022-04-13 15:57:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
do_ubuntu() {
|
2023-10-27 16:31:10 +08:00
|
|
|
RELEASE_SPECIFIC_PACKAGES="netcat"
|
2023-10-27 18:39:06 +08:00
|
|
|
if [ "${ID}" = "debian" ]; then
|
2023-10-27 16:31:10 +08:00
|
|
|
RELEASE_SPECIFIC_PACKAGES="netcat-openbsd"
|
|
|
|
fi
|
2022-04-13 15:57:46 +08:00
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
echo "Europe/Berlin" > /etc/timezone
|
|
|
|
apt-get update -y -q
|
|
|
|
apt-get install -y libsasl2-modules
|
|
|
|
apt-get install -y postfix
|
|
|
|
apt-get install -y opendkim
|
2023-10-27 23:44:20 +08:00
|
|
|
apt-get install -y ca-certificates tzdata supervisor rsyslog bash opendkim-tools curl libcurl4 libjsoncpp25 sasl2-bin postfix-lmdb logrotate cron net-tools ${RELEASE_SPECIFIC_PACKAGES}
|
2022-04-13 15:57:46 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ -f /etc/alpine-release ]; then
|
|
|
|
do_alpine
|
|
|
|
else
|
|
|
|
do_ubuntu
|
|
|
|
fi
|
|
|
|
|
|
|
|
cp -r /etc/postfix /etc/postfix.template
|