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
Simon Bruder fca6ae6360
All checks were successful
continuous-integration/drone/push Build is passing
Add option to block specific senders
2019-08-01 12:05:37 +00:00

32 lines
944 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-hotplug.sh c /etc/postfix/hotplug.d/ virtual
map-hotplug.sh c /etc/postfix/hotplug.d/ access_sender
inotifyd map-hotplug.sh /etc/postfix/hotplug.d/ &
/usr/libexec/postfix/master -c /etc/postfix -d