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/scripts/entrypoint.sh
2019-03-30 23:17:59 +00:00

31 lines
889 B
Bash
Executable file

#!/bin/sh
if ! [ -e /etc/postfix/dh-params/2048.pem ]; then
openssl dhparam -out /etc/postfix/dh-params/2048.pem -2 2048
fi
postconf -e myhostname="$MYHOSTNAME"
postconf -e mydomain="$MYDOMAIN"
postconf -e mail_name="$MAIL_NAME"
postconf -e message_size_limit="$MESSAGE_SIZE_LIMIT"
postconf -e virtual_mailbox_domains="$DOMAINS"
sed -i \
-e "s/@@LDAP_BASE@@/${LDAP_BASE}/g" \
-e "s/@@LDAP_HOST@@/${LDAP_SERVER}/g" \
-e "s/@@LDAP_USER@@/${LDAP_USER}/g" \
-e "s/@@LDAP_PASSWORD@@/${LDAP_PASSWORD}/g" \
/etc/postfix/virtual_mailbox_maps.cf
if ! [ -e /var/spool/postfix/.initialized ]; then
cp -r /var/spool/postfix-skel/* /var/spool/postfix
chown -R 100:101 /var/spool/postfix
touch /var/spool/postfix/.initialized
fi
map-virtual.sh c /etc/postfix/aliases.d/ virtual
inotifyd map-virtual.sh /etc/postfix/aliases.d/ &
/usr/libexec/postfix/master -c /etc/postfix -d