@@ -65,7 +65,27 @@ RUN apk --no-cache add \
6565 postconf smtpd_error_sleep_time=10s && \
6666 postconf smtpd_soft_error_limit=3 && \
6767 postconf smtpd_hard_error_limit=5 && \
68- newaliases
68+ newaliases && \
69+ # enable postscreen on port 25 and supporting services
70+ sed -i 's/^smtp\s\+ inet\s\+ n\s\+ -\s\+ y\s\+ -\s\+ -\s\+ smtpd/smtp inet n - y - 1 postscreen/' /etc/postfix/master.cf && \
71+ printf '%s\n ' \
72+ 'smtpd pass - - y - - smtpd' \
73+ 'dnsblog unix - - y - 0 dnsblog' \
74+ 'tlsproxy unix - - y - 0 tlsproxy' \
75+ >> /etc/postfix/master.cf && \
76+ postconf postscreen_dnsbl_sites='bl.spamcop.net*2' && \
77+ postconf postscreen_dnsbl_threshold=2 && \
78+ postconf postscreen_dnsbl_action=enforce && \
79+ echo "submission inet n - n - - smtpd" >> /etc/postfix/master.cf && \
80+ echo " -o syslog_name=postfix/submission" >> /etc/postfix/master.cf && \
81+ echo " -o smtpd_tls_security_level=encrypt" >> /etc/postfix/master.cf && \
82+ echo " -o smtpd_sasl_auth_enable=yes" >> /etc/postfix/master.cf && \
83+ echo " -o smtpd_tls_auth_only=yes" >> /etc/postfix/master.cf && \
84+ echo " -o smtpd_reject_unlisted_recipient=no" >> /etc/postfix/master.cf && \
85+ echo " -o smtpd_sender_restrictions=reject_sender_login_mismatch,permit_sasl_authenticated,reject" >> /etc/postfix/master.cf && \
86+ echo " -o smtpd_relay_restrictions=" >> /etc/postfix/master.cf && \
87+ echo " -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject" >> /etc/postfix/master.cf && \
88+ echo " -o milter_macro_daemon_name=ORIGINATING" >> /etc/postfix/master.cf
6989COPY --from=dockerize /bin/dockerize /usr/local/bin/dockerize
7090COPY rootfs/ /
7191
0 commit comments