mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #1602] SMTP sender always connects with an "EHLO localhost" rather than "EHLO <actual hostname>" #1123
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#1123
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 @konstantint on GitHub (Feb 10, 2026).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1602
🐞 Describe the bug
At the moment it is impossible to send SMTP notifications via, for example, smtp-relay.gmail.com, because that server rejects clients who begin their protocol exchange with an "EHLO localhost" command, but will accept literally any other value. This behaviour comes from the net/smtp library that simply hardcodes "localhost" as the host in the hello command.
The fix is not too complicated, although copy-pasteish. Let me know if you'd like me to make it into a PR. Note that in the example I replaced "localhost" with os.Hostname(), which in theory could break clients that somewhy relied on "localhost" specifically being used in the EHLO command. Perhaps a more gentle update would be to introduce a config setting providing the desired hostname, that defaults to "localhost".
Even if this is a peculiarity of Gmail's relay only, it is probably a large enough of a case to deserve supporting (also maybe there are good reasons for the server to reject "localhost").
💻 Components impacted
ntfy server
💡 Screenshots and/or logs