-
Notifications
You must be signed in to change notification settings - Fork 104
Configure postscreen for mta port 25 #530
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
3d7ac66
4042db3
a95d4fa
855ef06
98d3134
a8f805c
989e59b
9acad5b
1849d5b
07a7e10
bf3d19d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,27 @@ RUN apk --no-cache add \ | |
| postconf smtpd_error_sleep_time=10s && \ | ||
| postconf smtpd_soft_error_limit=3 && \ | ||
| postconf smtpd_hard_error_limit=5 && \ | ||
| newaliases | ||
| newaliases && \ | ||
| # enable postscreen on port 25 and supporting services | ||
| 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 && \ | ||
| printf '%s\n' \ | ||
| 'smtpd pass - - y - - smtpd' \ | ||
| 'dnsblog unix - - y - 0 dnsblog' \ | ||
| 'tlsproxy unix - - y - 0 tlsproxy' \ | ||
| >> /etc/postfix/master.cf && \ | ||
| postconf postscreen_dnsbl_sites='bl.spamcop.net*2' && \ | ||
| postconf postscreen_dnsbl_threshold=2 && \ | ||
| postconf postscreen_dnsbl_action=enforce && \ | ||
| echo "submission inet n - n - - smtpd" >> /etc/postfix/master.cf && \ | ||
| echo " -o syslog_name=postfix/submission" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_tls_security_level=encrypt" >> /etc/postfix/master.cf && \ | ||
|
||
| echo " -o smtpd_sasl_auth_enable=yes" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_tls_auth_only=yes" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_reject_unlisted_recipient=no" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_sender_restrictions=reject_sender_login_mismatch,permit_sasl_authenticated,reject" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_relay_restrictions=" >> /etc/postfix/master.cf && \ | ||
| echo " -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject" >> /etc/postfix/master.cf && \ | ||
| echo " -o milter_macro_daemon_name=ORIGINATING" >> /etc/postfix/master.cf | ||
| COPY --from=dockerize /bin/dockerize /usr/local/bin/dockerize | ||
| COPY rootfs/ / | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,5 +9,5 @@ RUN chown -R unbound:unbound /etc/unbound && \ | |
| COPY --chown=unbound:unbound rootfs/ / | ||
| USER unbound | ||
|
|
||
| EXPOSE 5353/tcp 5353/udp | ||
| EXPOSE 53/TCP 53/UDP | ||
|
||
| HEALTHCHECK CMD /usr/local/bin/healthcheck.sh | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| server: | ||
| chroot: "" | ||
| username: "" | ||
| port: 5353 | ||
| port: 53 | ||
| trust-anchor-file: "/etc/unbound/root.key" | ||
|
|
||
| do-ip6: no | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,17 @@ | ||
| #!/bin/sh | ||
| set -e | ||
|
|
||
| # Test DNS resolution using dig | ||
| if ! dig @127.0.0.1 -p 5353 github.com >/dev/null 2>&1; then | ||
| echo "Healthcheck failed: DNS resolution test failed" | ||
| exit 1 | ||
| # UDP check | ||
| if ! dig @127.0.0.1 -p 53 github.com +time=2 +tries=1 +short >/dev/null 2>&1; then | ||
| echo "Healthcheck failed: dig UDP to 127.0.0.1:53" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Test UDP connectivity (unbound typically uses UDP for DNS) | ||
| if ! dig @127.0.0.1 -p 5353 +tcp github.com >/dev/null 2>&1; then | ||
| echo "Healthcheck failed: TCP DNS resolution test failed" | ||
| exit 1 | ||
| # TCP check (no nc dependency) | ||
| if ! dig +tcp @127.0.0.1 -p 53 github.com +time=2 +tries=1 +short >/dev/null 2>&1; then | ||
| echo "Healthcheck failed: dig TCP to 127.0.0.1:53" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Healthcheck passed" | ||
|
|
||
| exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cursoragent change that directly in master.cf in the rootfs folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a look!