forked from wader/postfix-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (49 loc) · 1.66 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# bump: debian-buster-slim /FROM debian:(.*)/ docker:debian|/^buster-.*-slim/|sort
FROM debian:buster-20240211-slim
RUN set -eux; \
apt-get update && \
apt-get -y --no-install-recommends install \
procps \
postfix \
libsasl2-modules \
libpam-pwdfile \
sasl2-bin \
whois \
opendkim \
opendkim-tools \
ca-certificates \
rsyslog \
netcat && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* \
/etc/rsyslog.conf
# Default config:
# Open relay, trust docker links for firewalling.
# Try to use TLS when sending to other smtp servers.
# No TLS for connecting clients, trust docker network to be safe
ENV \
POSTFIX_mydestination=localhost \
POSTFIX_mynetworks=0.0.0.0/0 \
POSTFIX_smtp_tls_security_level=may \
POSTFIX_smtpd_tls_security_level=may \
POSTFIX_virtual_alias_domains= \
POSTFIX_virtual_alias_maps="hash:/etc/postfix/conf.d/virtual" \
POSTFIX_smtpd_recipient_restrictions="reject_unauth_destination, permit_sasl_authenticated, permit_mynetworks, check_relay_domains" \
POSTFIX_smtpd_tls_security_level=none \
OPENDKIM_Socket=inet:12301@localhost \
OPENDKIM_Mode=sv \
OPENDKIM_UMask=002 \
OPENDKIM_Syslog=yes \
OPENDKIM_TrustAnchorFile=/usr/share/dns/root.key \
OPENDKIM_InternalHosts="0.0.0.0/0, ::/0" \
OPENDKIM_KeyTable=/etc/opendkim/KeyTable \
OPENDKIM_SigningTable=refile:/etc/opendkim/SigningTable \
RSYSLOG_TIMESTAMP=no \
RSYSLOG_LOG_TO_FILE=no \
SASL_Passwds=""
RUN mkdir -p /etc/opendkim/keys
COPY run /root/
VOLUME ["/var/lib/postfix", "/var/mail", "/var/spool/postfix", "/etc/opendkim/keys", "/etc/postfix/conf.d"]
EXPOSE 25
CMD ["/root/run"]
HEALTHCHECK CMD nc -z 127.0.0.1 25 || exit 1