-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (30 loc) · 1.44 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM debian:bullseye-slim
EXPOSE 25
ENV POSTFIX_DOMAIN=yourdomain.tld
ENV POSTFIX_MAILNAME=yourreversednsmailhost
ENV POSTFIX_APPEND_VIRTUAL_ALIAS_CF=yes
ENV POSTFIX_APPEND_MYDESTINATION_CF=yes
ENV POSTFIX_TLS_CERT_PATH=smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
ENV POSTFIX_TLS_KEY_PATH=smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update &&\
apt-get install -q -y apt-utils
RUN apt-get update &&\
/bin/bash -c 'debconf-set-selections <<< "postfix postfix/mailname string ${POSTFIX_MAILNAME}"' &&\
/bin/bash -c 'debconf-set-selections <<< "postfix postfix/main_mailer_type string Internet Site"' &&\
/bin/bash -c 'debconf-set-selections <<< "opendmarc opendmarc/dbconfig-install boolean false"' &&\
apt-get install -q -y rsyslog postfix postfix-policyd-spf-python opendkim opendkim-tools opendmarc
ADD opendkim.conf /etc/opendkim.conf
ADD opendmarc.conf /etc/opendmarc.conf
ADD opendmarc_ignore.hosts /etc/opendmarc/ignore.hosts
RUN chown opendmarc:opendmarc -R /etc/opendmarc/ignore.hosts
RUN mkdir -p /var/spool/postfix/opendmarc
RUN chown opendmarc:opendmarc /var/spool/postfix/opendmarc -R
RUN adduser postfix opendmarc
RUN /bin/bash -c 'echo "opendmarc: root" >> /etc/aliases'
ADD main.cf /etc/postfix/main.cf
ADD logrotate.conf /etc/logrotate.conf
ADD rsyslog /etc/logrotate.d/rsyslog
ADD start_script.sh /
RUN chmod +x /start_script.sh
CMD ["/start_script.sh"]