Skip to content

Commit 387d7ac

Browse files
committed
Fixes #1875 - Add Nginx SMTP dummy
1 parent 6fbee2b commit 387d7ac

File tree

12 files changed

+57
-1
lines changed

12 files changed

+57
-1
lines changed

docker/batch-test.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ WEBSERVER_PORT=80
8181
WEBSERVER_PORT_TLS=443
8282
WEBSERVER_PORT_IPV6=8080
8383
WEBSERVER_PORT_IPV6_TLS=4443
84+
SMTPSERVER_PORT=25
85+
SMTPSERVER_PORT_IPV6=2525
8486
UNBOUND_PORT_TCP=53/tcp
8587
UNBOUND_PORT_UDP=53/udp
8688
# use fake port numbers here so we don't end up with duplicates in the compose file which causes an error

docker/build.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ COMPOSE_PROFILES=monitoring,routinator,run-tests
88
# don't expose HTTP(S) and DNS ports to the outside, this also causes issues due to being privileged ports
99
WEBSERVER_PORT=80
1010
WEBSERVER_PORT_TLS=443
11+
SMTPSERVER_PORT=25
12+
SMTPSERVER_PORT_IPV6=2525
1113
UNBOUND_PORT_TCP=53/tcp
1214
UNBOUND_PORT_UDP=53/udp
1315
# use fake port numbers here so we don't end up with duplicates in the compose file which causes an error

docker/compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ services:
2727
- $WEBSERVER_PORT_IPV6/tcp
2828
- $WEBSERVER_PORT_IPV6_TLS/tcp
2929
- $WEBSERVER_PORT_IPV6_TLS/udp
30+
- $SMTPSERVER_PORT
31+
- $SMTPSERVER_PORT_IPV6
3032

3133
environment:
3234
- INTERNETNL_DOMAINNAME

docker/defaults.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ WEBSERVER_PORT=0.0.0.0:80:80
172172
WEBSERVER_PORT_TLS=0.0.0.0:443:443
173173
WEBSERVER_PORT_IPV6=::0:80:80
174174
WEBSERVER_PORT_IPV6_TLS=::0:443:443
175+
SMTPSERVER_PORT=0.0.0.0:25:25
176+
SMTPSERVER_PORT_IPV6=::0:25:25
175177
UNBOUND_PORT_TCP=0.0.0.0:53:53/tcp
176178
UNBOUND_PORT_UDP=0.0.0.0:53:53/udp
177179
UNBOUND_PORT_IPV6_TCP=::0:53:53/tcp

docker/develop.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ WEBSERVER_PORT=80
4949
WEBSERVER_PORT_TLS=443
5050
WEBSERVER_PORT_IPV6=8080
5151
WEBSERVER_PORT_IPV6_TLS=4443
52+
SMTPSERVER_PORT=25
53+
SMTPSERVER_PORT_IPV6=2525
5254
UNBOUND_PORT_TCP=53/tcp
5355
UNBOUND_PORT_UDP=53/udp
5456
# use fake port numbers here so we don't end up with duplicates in the compose file which causes an error

docker/host-multi-dist.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ WEBSERVER_PORT_TLS=$IPV4_IP_PUBLIC:443:443
3535
WEBSERVER_PORT_IPV6=$IPV6_IP_PUBLIC:80:80
3636
WEBSERVER_PORT_IPV6_TLS=[$IPV6_IP_PUBLIC]:443:443
3737

38+
SMTPSERVER_PORT=$IPV4_IP_PUBLIC:25:25
39+
SMTPSERVER_PORT_IPV6=[$IPV6_IP_PUBLIC]:25:25
40+
3841
IPV4_SUBNET_PUBLIC=$IPV4_SUBNET_PUBLIC
3942
IPV4_SUBNET_INTERNAL=$IPV4_SUBNET_INTERNAL
4043

docker/test.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ WEBSERVER_PORT=80
8080
WEBSERVER_PORT_TLS=443
8181
WEBSERVER_PORT_IPV6=8080
8282
WEBSERVER_PORT_IPV6_TLS=4443
83+
SMTPSERVER_PORT=25
84+
SMTPSERVER_PORT_IPV6=2525
8385
UNBOUND_PORT_TCP=53/tcp
8486
UNBOUND_PORT_UDP=53/udp
8587
# use fake port numbers here so we don't end up with duplicates in the compose file which causes an error

docker/webserver.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUN mkdir -p /etc/nginx/htpasswd/
2020
RUN touch /etc/nginx/htpasswd/monitoring.htpasswd
2121

2222
COPY docker/webserver/10-variables.envsh /docker-entrypoint.d/
23+
COPY docker/webserver/40-add-mail-include.sh /docker-entrypoint.d/
2324
COPY docker/webserver/tls_init.sh /docker-entrypoint.d/
2425
COPY docker/webserver/authentication.sh /docker-entrypoint.d/
2526
COPY docker/webserver/generate_quic_host_key.sh /docker-entrypoint.d/
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
LC_ALL=C
6+
ME=$(basename "$0")
7+
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8+
9+
touch /etc/nginx/nginx.conf 2>/dev/null || { echo >&2 "$ME: error: can not modify /etc/nginx/nginx.conf (read-only file system?)"; exit 0; }
10+
11+
sed -i -r -z 's@(\}\n)$@\1# Added by '"$ME"' on '"$(date)"'\nmail {\n include conf.d/*.mail-conf;\n}\n@' /etc/nginx/nginx.conf
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server_name ${SMTP_EHLO_DOMAIN};
2+
auth_http http://127.0.0.1:9090/;
3+
4+
starttls only;
5+
6+
include conf.d/letsencrypt.conf;
7+
8+
ssl_protocols TLSv1.2 TLSv1.3;
9+
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
10+
11+
server {
12+
listen 25;
13+
listen [::]:25;
14+
protocol smtp;
15+
smtp_capabilities "SIZE 1099511627776" ENHANCEDSTATUSCODES 8BITMIME DSN SMTPUTF8 REQUIRETLS;
16+
}

0 commit comments

Comments
 (0)