feat: self-hosted postfix

This commit is contained in:
2026-01-24 08:43:50 +01:00
parent e46cb018fd
commit eeed88eba4
16 changed files with 2830 additions and 652 deletions

30
docker/postfix/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM debian:bookworm-slim
# install oostfix and OpenDKIM
RUN apt-get update && apt-get install -y \
postfix \
opendkim \
opendkim-tools \
mailutils \
ca-certificates \
netcat-openbsd \
&& rm -rf /var/lib/apt/lists/*
# create OpenDKIM paths
RUN mkdir -p /etc/opendkim/keys && \
chown -R opendkim:opendkim /etc/opendkim && \
chmod 700 /etc/opendkim/keys
# copy config
COPY postfix-main.cf /etc/postfix/main.cf
COPY opendkim.conf /etc/opendkim.conf
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 25
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD echo "QUIT" | nc -w 5 localhost 25 | grep -q "220" || exit 1
ENTRYPOINT ["/entrypoint.sh"]