mirror of
https://github.com/louislam/uptime-kuma.git
synced 2026-03-02 22:57:00 -05:00
Version 2 SMTP checks appear not to respect /etc/hosts #4616
Labels
No labels
A:accessibility
A:api
A:cert-expiry
A:core
A:dashboard
A:deployment
A:documentation
A:domain expiry
A:incidents
A:maintenance
A:metrics
A:monitor
A:notifications
A:reports
A:settings
A:status-page
A:ui/ux
A:user-management
Stale
ai-slop
blocked
blocked-upstream
bug
cannot-reproduce
dependencies
discussion
duplicate
feature-request
feature-request
good first issue
hacktoberfest
help
help wanted
house keeping
invalid
invalid-format
invalid-format
question
releaseblocker 🚨
security
spam
type:enhance-existing
type:new
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/uptime-kuma#4616
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Stevehans on GitHub (Jan 16, 2026).
📑 I have found these related issues/pull requests
Possibly 1822
🛡️ Security Policy
📝 Description
Environment:
Docker running latest v2
Start command:
docker run -d --restart=always -p 3001:3001 -v uptime-kuma:/app/data --add-host mail.mydomain.com:172.30.1.18 --name uptime-kuma louislam/uptime-kuma:2
I have a host override in my /etc/hosts file
connect using docker exec
I have checked with NCSD enabled and disabled to rule this out.
I'll check how the SMTP test resolves the host now and update this if that is the issue.
👟 Reproduction steps
Create an SMTP monitor, set the verification to SMTPS and set the host to mail.mydomain.com (to match the host file)
Connection will not use the IP address in the host file but be resolved by the resolver.
👀 Expected behavior
Should use the IP address from /etc/hosts
😓 Actual Behavior
Appears to perform a lookup on mail.mydomain.com, which is then resolved to the wildcard address as there is no specific entry in the external public dns
🐻 Uptime-Kuma Version
2.0.2
💻 Operating System and Arch
Built container OS
🌐 Browser
Chrome
🖥️ Deployment Environment
📝 Relevant log output
@Stevehans commented on GitHub (Jan 16, 2026):
https://github.com/nodemailer/nodemailer/issues/1283
This appears to be the issue, nodemailer uses dns,resolve which does not use the /etc/hosts file
For my purposes it would be ideal if there was an extra field for tls.servername, then we could use an IP and everything would work as it should:
From https://nodemailer.com/smtp
@CommanderStorm commented on GitHub (Jan 16, 2026):
Mail servers usually don't need some magic in
/etc/hosts, so I would like to not add an option to overidetls.servername.Usually, your monitoring server is external of what you are trying to monitor -> not the main usecase to use us to send messages directly as you suggested.
If you would still like to contribute this, I think we can accept this if:
@Stevehans commented on GitHub (Jan 19, 2026):
I'll look at compiling a pull request.
Use case is:-