[BUG] SMTP listener now binds to EMAIL_PORT instead of 2525 since the gunicorn switch 5.0.3-ls373
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- devops, infrastructure
Direzione di ricerca
Il bug si trova nello script di esecuzione del servizio s6 in /etc/s6-overlay/s6-rc.d/svc-healthchecks-smtpd/run, che passa EMAIL_PORT a manage.py smtpd e va in sleep quando la variabile non è impostata. Inizia da lì e verifica se il listener in ingresso dovrebbe invece leggere una propria variabile (come SMTPD_PORT) con il valore predefinito 2525. È completato quando il listener si collega alla porta 2525 con EMAIL_PORT impostata a 465, e si avvia quando EMAIL_PORT non è impostata; verifica con ps all'interno del container e con un'email di prova inviata alla porta 25.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Dockerfile
- Stelle
- 205
- Fork
- 39
- Merge medio
- 3h 45m
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
BenjaminPoilve/minichord#203 ·
-
area:infra help wanted type:ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
JoeyHammoth/semiconductor-bandgap-belvedere#62 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
NuSkooler/enigma-bbs#1215 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
nlewo/comin#245 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100