Skip to content

self-hosted mailtrain error: nc: getaddrinfo: Name does not resolve #1387

@shadowaero

Description

@shadowaero

Trying to install mailtrain for docker. I get this error in log of mailtrain nc: getaddrinfo: Name does not resolve.
All 3 containers are tied to the network mailtrain_net.
Image

Here is log from mariadb
2025-10-17 16:13:56 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2025-10-17 16:13:56 0 [Note] InnoDB: 10.6.23 started; log sequence number 42790; transaction id 14
2025-10-17 16:13:56 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2025-10-17 16:13:56 0 [Note] Plugin 'FEEDBACK' is disabled.
2025-10-17 16:13:56 0 [Note] InnoDB: Buffer pool(s) load completed at 251017 16:13:56
2025-10-17 16:13:56 0 [Warning] You need to use --log-bin to make --expire-logs-days or --binlog-expire-logs-seconds work.
2025-10-17 16:13:56 0 [Note] Server socket created on IP: '0.0.0.0'.
2025-10-17 16:13:56 0 [Note] Server socket created on IP: '::'.
2025-10-17 16:13:56 0 [Note] mariadbd: ready for connections.
Version: '10.6.23-MariaDB-ubu2204' socket: '/run/mysqld/mysqld.sock' port: 3306 mariadb.org binary distribution
2025-10-17 16:14:05 3 [Warning] Access denied for user 'root'@'localhost' (using password: NO)

Redis says waiting for connection.

Here is the docker compose (portainer stack). Passwords and usernames are not real. I have tried both external and internal networks.
services:
mailtrain:
image: mailtrain/mailtrain:latest
container_name: mailtrain
restart: always
ports:
- 8090:3000
environment:
- PUID=999
- PGID=10
- TZ=America/New_York
# --- Database ---
- DB_HOST=mariadb
- DB_USER=mailtrain
- DB_PASS=ABC123
- DB_NAME=mailtrain
- REDIS_HOST=redis
# --- SMTP (Gmail) ---
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USERNAME=[email protected]
- SMTP_PASSWORD=abcdabcdabcd
- SMTP_SECURE=true # If auth fails on 587, set to "false" for STARTTLS
- MAIL_FROM_ADDRESS=[email protected]
depends_on:
- mariadb
- redis
volumes:
- /volume1/docker/mailtrain/config:/config
- /volume1/docker/mailtrain/data:/data
networks:
- mailtrain_net
command: sh -c "sleep 10 && node index.js"

mariadb:
image: mariadb:10.6
container_name: mariadb2
restart: always
environment:
- MYSQL_ROOT_PASSWORD=ABC123
- MYSQL_DATABASE=mailtrain
- MYSQL_USER=mailtrain
- MYSQL_PASSWORD=ABC123
- TZ=America/New_York
volumes:
- /volume1/docker/mariadb2/data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
- mailtrain_net

redis:
image: redis:6
container_name: redis
restart: always
command: ["redis-server", "--appendonly", "yes"]
volumes:
- /volume1/docker/redis/data:/data
healthcheck:
test: ["CMD", "redis-cli", "PING"]
interval: 10s
timeout: 5s
retries: 5
networks:
- mailtrain_net

networks:
mailtrain_net:
external: true

I can follow instructions but do not know the linux commands to do alot of stuff. I followed Chatgpt5 and gemini 2.5pro to do a lot of troubleshooting but nothing worked.

thank you in advance for any help or comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions