[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- devops, infrastructure
Research direction
The bug is in the s6 service run script at /etc/s6-overlay/s6-rc.d/svc-healthchecks-smtpd/run, which passes EMAIL_PORT to manage.py smtpd and sleeps when it is unset. Start there and check whether the inbound listener should read its own variable (such as SMTPD_PORT) with a default of 2525 instead. Done means the listener binds to 2525 with EMAIL_PORT set to 465, and starts when EMAIL_PORT is unset; verify with ps inside the container and a test email to port 25.
Written by the indexing model from the issue text.
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Healthchecks sends outbound emails via Django's built-in SMTP email backend. I configure my SMTP relay with EMAIL_PORT = 465.
Since 5.0.3-ls373 (the "Switch to gunicorn" change), the incoming SMTP listener follows EMAIL_PORT instead of staying on 2525. This broke incoming emails until I changed my Compose port map from 25:2525 to 25:465.
If EMAIL_PORT isn't set at all, the listener doesn't even start (the run script falls through to sleep infinity), so anyone relying on inbound email without configuring outbound SMTP is also broken with this update.
Expected Behavior
The inbound SMTP listener should ignore the outbound SMTP settings, and shouldn't fail to start when the outbound SMTP port is not configured.
Suggested fix: define another variable (e.g. SMTPD_PORT) to define the inbound port, and fall back to default 2525 when not set.
Steps To Reproduce
- Run 5.0.3-ls373 or later with EMAIL_PORT=465 and -p 25:2525.
- Send an email ping to the container.
- The connection is refused. ps inside the container shows manage.py smtpd --port 465.
Environment
Docker Compose, x86_64, image lscr.io/linuxserver/healthchecks:latest at 5.0.3-ls373, via NixOS Docker module, managed by Komodo.
CPU architecture
x86-64
Docker creation
services:
healthchecks:
image: lscr.io/linuxserver/healthchecks:5.0.3-ls373
restart: unless-stopped
volumes:
- /opt/docker/healthchecks:/config
ports:
- 25:2525 # worked before ls373; now needs 25:465
environment:
PUID: "1000"
PGID: "1000"
SITE_ROOT: "https://healthchecks.example.com"
ALLOWED_HOSTS: "healthchecks.example.com"
PING_EMAIL_DOMAIN: "healthchecks.example.com"
DEFAULT_FROM_EMAIL: "[email protected]"
EMAIL_HOST: "smtp.example.com"
EMAIL_PORT: "465"
EMAIL_HOST_USER: "[email protected]"
EMAIL_HOST_PASSWORD: "<redacted>"
EMAIL_USE_TLS: "False"
EMAIL_USE_SSL: "True"
SECRET_KEY: "<redacted>"
Container logs
$ docker exec healthchecks-healthchecks-1 ps aux | grep smtpd
root 42 ... s6-supervise svc-healthchecks-smtpd
abc 178 ... python3 ./manage.py smtpd --port 465
$ cat /etc/s6-overlay/s6-rc.d/svc-healthchecks-smtpd/run
#!/usr/bin/with-contenv bash
cd /app/healthchecks || exit 1
if [[ -n ${EMAIL_PORT} ]]; then
exec s6-setuidgid abc python3 ./manage.py smtpd --port "${EMAIL_PORT}"
else
sleep infinity
fi
- Dominant language
- Dockerfile
- Stars
- 206
- Forks
- 39
- Avg merge
- 3h 45m
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
canary-dead
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
activescott/home-infra-k8s-flux#578 ·
Maintainers usually reply within 1 day
-
repo-harnesses: the entrypoint-guard check greps a message `#13692` reworded, so it fails on mainOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
daniel-ospina/tortoise#14947 ·
Maintainers usually reply within 1 day
-
area: infra tier: p3 type: chore
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
flashinfer-ai/flashinfer#10251 ·
Maintainers usually reply within 1 day