[GH-ISSUE #800] SMTPD refuses connection after 2.7 update using Docker #563

Closed
opened 2026-02-25 23:42:52 +03:00 by kerem · 2 comments
Owner

Originally created by @marcogiorgio on GitHub (Mar 7, 2023).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/800

Hi, I have a docker-compose file that looks like this:

docker-compose.yml

Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the <details> tag... just make sure you close <details> afterward.

version: "3"
services:
healthchecks:
  image: healthchecks/healthchecks:latest
  container_name: healthchecks
  user: "${PUID}:${PGID}"
  environment:
    - DB_NAME=${DB_NAME}
    - DEBUG=${DEBUG}
    - SITE_ROOT=${SITE_ROOT}
    - SITE_NAME=${SITE_NAME}
    - DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL}
    - PING_EMAIL_DOMAIN=${PING_EMAIL_DOMAIN}
    - PING_ENDPOINT=${PING_ENDPOINT}
    - REGISTRATION_OPEN=${REGISTRATION_OPEN}
    - EMAIL_HOST=${EMAIL_HOST}
    - EMAIL_PORT=${EMAIL_PORT}
    - EMAIL_HOST_USER=${EMAIL_HOST_USER}
    - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
    - EMAIL_USE_TLS=${EMAIL_USE_TLS}
    - SUPERUSER_EMAIL=${SUPERUSER_EMAIL}
    - SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD}
    - APPRISE_ENABLED=${APPRISE_ENABLED}
    - SITE_LOGO_URL=${SITE_LOGO_URL}
    - SECRET_KEY=${SECRET_KEY}
    - SMTPD_PORT=${SMTPD_PORT}
  volumes:
    - config:/config
  ports:
    - 8001:8000
    - 2525:25
  restart: always

volumes:
config:

I noticed that since the 2.7 update, I cannot connect anymore to the smtpd daemon by using any interfaces but localhost. For example:

telnet localhost 2525: this works
telnet SERVER_IP 2525: this does not work anymore

If I revert the image back to 2.6.1 everything starts working as intended again. Is anyone experiencing the same problem?
Thanks

Originally created by @marcogiorgio on GitHub (Mar 7, 2023). Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/800 Hi, I have a docker-compose file that looks like this: <details> <summary>docker-compose.yml</summary> Spoiler text. Note that it's important to have a space after the summary tag. You should be able to write any markdown you want inside the `<details>` tag... just make sure you close `<details>` afterward. ```yaml version: "3" services: healthchecks: image: healthchecks/healthchecks:latest container_name: healthchecks user: "${PUID}:${PGID}" environment: - DB_NAME=${DB_NAME} - DEBUG=${DEBUG} - SITE_ROOT=${SITE_ROOT} - SITE_NAME=${SITE_NAME} - DEFAULT_FROM_EMAIL=${DEFAULT_FROM_EMAIL} - PING_EMAIL_DOMAIN=${PING_EMAIL_DOMAIN} - PING_ENDPOINT=${PING_ENDPOINT} - REGISTRATION_OPEN=${REGISTRATION_OPEN} - EMAIL_HOST=${EMAIL_HOST} - EMAIL_PORT=${EMAIL_PORT} - EMAIL_HOST_USER=${EMAIL_HOST_USER} - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD} - EMAIL_USE_TLS=${EMAIL_USE_TLS} - SUPERUSER_EMAIL=${SUPERUSER_EMAIL} - SUPERUSER_PASSWORD=${SUPERUSER_PASSWORD} - APPRISE_ENABLED=${APPRISE_ENABLED} - SITE_LOGO_URL=${SITE_LOGO_URL} - SECRET_KEY=${SECRET_KEY} - SMTPD_PORT=${SMTPD_PORT} volumes: - config:/config ports: - 8001:8000 - 2525:25 restart: always volumes: config: ``` </details> I noticed that since the 2.7 update, I cannot connect anymore to the smtpd daemon by using any interfaces but localhost. For example: `telnet localhost 2525`: this works `telnet SERVER_IP 2525`: this does not work anymore If I revert the image back to `2.6.1` everything starts working as intended again. Is anyone experiencing the same problem? Thanks
kerem closed this issue 2026-02-25 23:42:52 +03:00
Author
Owner

@cuu508 commented on GitHub (Mar 7, 2023):

I just tested the docker-compose.yml file that is in the repository:

docker-compose.yml
version: "3"
volumes:
    db-data:

services:
  db:
    image: postgres:12
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=$DB_NAME
      - POSTGRES_PASSWORD=$DB_PASSWORD
  web:
    build:
        context: ..
        dockerfile: docker/Dockerfile
    env_file:
        - .env
    ports:
        - "8000:8000"
        # To enable SMTP on port 2525, set SMTPD_PORT=2525 in .env
        # and uncomment the following line:
        - "2525:2525"
    depends_on:
        - db
    command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uwsgi /opt/healthchecks/docker/uwsgi.ini'

(I uncommented the port 2525 forward, and I added SMTPD_PORT=2525 in .env)

It listens on 0.0.0.0 which is "all interfaces":

netstat -l | grep 2525
tcp        0      0 0.0.0.0:2525            0.0.0.0:*               LISTEN     
tcp6       0      0 [::]:2525               [::]:*                  LISTEN  

I'm testing this on Ubuntu 22.04, Docker 23.0.1, docker-compose 1.29.2.

<!-- gh-comment-id:1458171348 --> @cuu508 commented on GitHub (Mar 7, 2023): I just tested the docker-compose.yml file that is in the repository: <details> <summary>docker-compose.yml</summary> ```` version: "3" volumes: db-data: services: db: image: postgres:12 volumes: - db-data:/var/lib/postgresql/data environment: - POSTGRES_DB=$DB_NAME - POSTGRES_PASSWORD=$DB_PASSWORD web: build: context: .. dockerfile: docker/Dockerfile env_file: - .env ports: - "8000:8000" # To enable SMTP on port 2525, set SMTPD_PORT=2525 in .env # and uncomment the following line: - "2525:2525" depends_on: - db command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uwsgi /opt/healthchecks/docker/uwsgi.ini' ```` </details> (I uncommented the port 2525 forward, and I added `SMTPD_PORT=2525` in `.env`) It listens on 0.0.0.0 which is "all interfaces": ``` netstat -l | grep 2525 tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN tcp6 0 0 [::]:2525 [::]:* LISTEN ``` I'm testing this on Ubuntu 22.04, Docker 23.0.1, docker-compose 1.29.2.
Author
Owner

@marcogiorgio commented on GitHub (Mar 7, 2023):

Ah I see, I had to change the internal port to 2525 as well in my docker-compose.yml (instead of 25). Thanks!

<!-- gh-comment-id:1458187345 --> @marcogiorgio commented on GitHub (Mar 7, 2023): Ah I see, I had to change the internal port to `2525` as well in my `docker-compose.yml` (instead of `25`). Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/healthchecks#563
No description provided.