diff --git a/Dockerfile b/Dockerfile index e4a64bc..c2da8eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,8 @@ FROM crazymax/alpine-s6:${ALPINE_VERSION}-2.2.0.3 ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \ TZ="UTC" \ PUID="1500" \ - PGID="1500" + PGID="1500" \ + LISTEN_PORT="2500" RUN apk --update --no-cache add \ bash \ @@ -54,4 +55,4 @@ COPY rootfs / EXPOSE 2500 HEALTHCHECK --interval=10s --timeout=5s \ - CMD printf 'EHLO localhost\r\nQUIT\r\n' | nc -w 2 127.0.0.1 2500 | grep -q '^250' || exit 1 + CMD printf 'EHLO localhost\r\nQUIT\r\n' | nc -w 2 127.0.0.1 "$LISTEN_PORT" | grep -q '^250' || exit 1 diff --git a/README.md b/README.md index 6adbcd2..1cc4170 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ linux/s390x * `TZ`: Timezone assigned to the container (default `UTC`) * `PUID`: Daemon user id (default `1500`) * `PGID`: Daemon group id (default `1500`) +* `LISTEN_PORT`: Container listen port for msmtpd, useful with host, macvlan, or ipvlan networking (default `2500`) * `SMTP_HOST`: SMTP relay server to send the mail to. **required** * `SMTP_PORT`: Port that the SMTP relay server listens on. Default `25` or `465` if TLS. * `SMTP_TLS`: Enable or disable TLS (also known as SSL) for secured connections (`on` or `off`). @@ -107,7 +108,7 @@ linux/s390x ## Ports -* `2500`: SMTP relay port +* `2500`: SMTP relay port, configurable through `LISTEN_PORT` ## Usage diff --git a/rootfs/etc/cont-init.d/03-create-service.sh b/rootfs/etc/cont-init.d/03-create-service.sh index 4917eae..aadb26e 100644 --- a/rootfs/etc/cont-init.d/03-create-service.sh +++ b/rootfs/etc/cont-init.d/03-create-service.sh @@ -6,6 +6,6 @@ cat > /etc/services.d/msmtpd/run <