diff --git a/docker/postfix/Dockerfile b/docker/postfix/Dockerfile index db8b672e..f9e3919a 100644 --- a/docker/postfix/Dockerfile +++ b/docker/postfix/Dockerfile @@ -1,51 +1,51 @@ FROM almalinux:8 LABEL maintainer="contact@apheleia-it.ch" LABEL dist=centos8 LABEL tier=${TIER} ENV DISTRO=centos8 # ENV LANG=en_US.utf8 # ENV LC_ALL=en_US.utf8 -# ENV APP_DOMAIN -# ENV LMTP_DESTINATION -# ENV DB_HOST -# ENV DB_USERNAME -# ENV DB_PASSWORD -# ENV DB_DATABASE # Add EPEL. RUN dnf -y install dnf-plugin-config-manager && \ dnf config-manager --set-enabled powertools && \ dnf -y install \ epel-release \ python3 \ python3-requests \ postfix \ postfix-mysql \ cyrus-sasl \ cyrus-sasl-plain \ procps-ng \ iputils \ bind-utils \ tcpdump \ vim-enhanced && \ dnf clean all RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8 RUN sed -i -r -e 's/^SELINUX=.*$/SELINUX=permissive/g' /etc/selinux/config 2>/dev/null || : WORKDIR /root/ COPY /rootfs / VOLUME [ "/var/spool/postfix" ] VOLUME [ "/var/lib/postfix" ] ENV SERVICES_PORT=8000 # ENV APP_SERVICES_DOMAIN # ENV APP_DOMAIN +# ENV LMTP_DESTINATION +ENV MYNETWORKS="172.0.0.0/8" +# ENV DB_HOST +# ENV DB_USERNAME +# ENV DB_PASSWORD +# ENV DB_DATABASE CMD ["/init.sh"] EXPOSE 10025/tcp 10587/tcp diff --git a/docker/postfix/rootfs/init.sh b/docker/postfix/rootfs/init.sh index ce4ed4c0..7ac7a968 100755 --- a/docker/postfix/rootfs/init.sh +++ b/docker/postfix/rootfs/init.sh @@ -1,47 +1,47 @@ #!/bin/bash set -e cat ${SSL_CERTIFICATE} ${SSL_CERTIFICATE_FULLCHAIN} ${SSL_CERTIFICATE_KEY} > /etc/pki/tls/private/postfix.pem chown postfix:mail /etc/pki/tls/private/postfix.pem chmod 655 /etc/pki/tls/private/postfix.pem sed -i -r \ -e "s|APP_SERVICES_DOMAIN|$APP_SERVICES_DOMAIN|g" \ -e "s|SERVICES_PORT|$SERVICES_PORT|g" \ /etc/saslauthd.conf /usr/sbin/saslauthd -m /run/saslauthd -a httpform -d & # If host mounting /var/spool/postfix, we need to delete old pid file before # starting services rm -f /var/spool/postfix/pid/master.pid /usr/libexec/postfix/aliasesdb /usr/libexec/postfix/chroot-update sed -i -r \ -e "s|LMTP_DESTINATION|$LMTP_DESTINATION|g" \ /etc/postfix/main.cf sed -i -r \ -e "s|APP_DOMAIN|$APP_DOMAIN|g" \ - -e "s|MYNETWORKS|172.18.0.0/24|g" \ + -e "s|MYNETWORKS|$MYNETWORKS|g" \ /etc/postfix/main.cf sed -i -r \ -e "s|SERVICES_HOST|http://$APP_SERVICES_DOMAIN:$SERVICES_PORT|g" \ /usr/libexec/postfix/kolab_policy* sed -i -r \ -e "s|DB_HOST|$DB_HOST|g" \ -e "s|DB_USERNAME|$DB_USERNAME|g" \ -e "s|DB_PASSWORD|$DB_PASSWORD|g" \ -e "s|DB_DATABASE|$DB_DATABASE|g" \ /etc/postfix/sql/* # echo "/$APP_DOMAIN/ lmtp:$LMTP_DESTINATION" >> /etc/postfix/transport # postmap /etc/postfix/transport /usr/sbin/postfix check exec /usr/sbin/postfix -c /etc/postfix start-fg