28 lines
771 B
Docker
28 lines
771 B
Docker
FROM debian:stable-slim
|
|
|
|
# Install Postfix and tools
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -y \
|
|
postfix \
|
|
libsasl2-modules \
|
|
mailutils \
|
|
gettext-base \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy configs
|
|
COPY main.cf.template /etc/postfix/main.cf.template
|
|
COPY sasl_passwd.template /etc/postfix/sasl_passwd.template
|
|
COPY virtual_aliases.cf /etc/postfix/virtual_aliases.cf
|
|
COPY sender_access /etc/postfix/sender_access
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# Generate Postfix maps for virtual aliases and sender access
|
|
RUN postmap /etc/postfix/virtual_aliases.cf
|
|
RUN postmap /etc/postfix/sender_access
|
|
|
|
# Expose SMTP
|
|
EXPOSE 25
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|