This repository has been archived on 2021-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
mail/postfix/postfix.sh

28 lines
825 B
Bash
Raw Normal View History

2018-03-08 15:45:31 +01:00
#!/bin/sh
2018-03-15 16:32:17 +01:00
[ -e /etc/postfix/dh-params/512.pem ] || openssl gendh -out /etc/postfix/dh-params/512.pem -2 512
[ -e /etc/postfix/dh-params/2048.pem ] || openssl gendh -out /etc/postfix/dh-params/2048.pem -2 2048
2018-03-08 15:45:31 +01:00
2018-03-15 16:32:17 +01:00
postconf -e myhostname="$MYHOSTNAME"
postconf -e mydomain="$MYDOMAIN"
postconf -e mail_name="$MAIL_NAME"
2018-03-08 15:45:31 +01:00
2018-03-15 16:32:17 +01:00
postconf -e message_size_limit="$MESSAGE_SIZE_LIMIT"
2018-03-08 15:45:31 +01:00
2018-03-15 16:32:17 +01:00
postconf -e smtpd_tls_key_file="$TLS_KEY"
postconf -e smtpd_tls_cert_file="$TLS_FULLCHAIN"
2018-03-08 15:45:31 +01:00
postmap /etc/postfix/virtual
2018-03-15 16:32:17 +01:00
postmap /etc/postfix/domains
# is mounted, so no default structure
(
cd /var/spool/postfix
chown postfix:postfix .
for dir in active bounce corrupt defer deferred flush hold incoming maildrop pid private public saved trace; do
mkdir -p $dir
chown postfix:postfix $dir
done
)
exec /usr/lib/postfix/master -c /etc/postfix -d