[PR #1164] [MERGED] Support SMTP Auth Plain for event publishing #1528

Closed
opened 2026-05-07 01:02:31 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/binwiederhier/ntfy/pull/1164
Author: @bishtawi
Created: 8/8/2024
Status: Merged
Merged: 9/29/2024
Merged by: @binwiederhier

Base: mainHead: bishtawi/smtp-auth


📝 Commits (1)

📊 Changes

2 files changed (+38 additions, -6 deletions)

View changed files

📝 server/smtp_server.go (+16 -6)
📝 server/smtp_server_test.go (+22 -0)

📄 Description

Hi, very cool project. I am currently looking into hosting the server and I need to authenticate the services that are publishing notifications emails. I read the docs and saw that you can include an access token as part of the email (ntfy-$topic+$token@ntfy.sh) but unfortunately that solution does not work for my usecase. Access tokens are sensitive information and with my set up, email addresses are not. Including access tokens as part of the email address is not a feasible solution.

SMTP has authentication protocols and a common one is AUTH PLAIN which your SMTP dependency (go-smtp) supports. We can hook up the SMTP AUTH PLAIN command to forward the credentials to the ntfy server and authenticate using basic auth.

I was honestly surprised at how easy it was to implement this, but I believe these are all the changes necessary. Let me know if there is anything else required.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/binwiederhier/ntfy/pull/1164 **Author:** [@bishtawi](https://github.com/bishtawi) **Created:** 8/8/2024 **Status:** ✅ Merged **Merged:** 9/29/2024 **Merged by:** [@binwiederhier](https://github.com/binwiederhier) **Base:** `main` ← **Head:** `bishtawi/smtp-auth` --- ### 📝 Commits (1) - [`112efaa`](https://github.com/binwiederhier/ntfy/commit/112efaae90ceb03310e49280c902e755b596ea09) Support SMTP Auth Plain ### 📊 Changes **2 files changed** (+38 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `server/smtp_server.go` (+16 -6) 📝 `server/smtp_server_test.go` (+22 -0) </details> ### 📄 Description Hi, very cool project. I am currently looking into hosting the server and I need to authenticate the services that are publishing ~~notifications~~ emails. I read the docs and saw that you can include an access token as part of the email (`ntfy-$topic+$token@ntfy.sh`) but unfortunately that solution does not work for my usecase. Access tokens are sensitive information and with my set up, email addresses are not. Including access tokens as part of the email address is not a feasible solution. SMTP has authentication protocols and a common one is AUTH PLAIN which your SMTP dependency (go-smtp) supports. We can hook up the SMTP AUTH PLAIN command to forward the credentials to the ntfy server and authenticate using basic auth. I was honestly surprised at how easy it was to implement this, but I believe these are all the changes necessary. Let me know if there is anything else required. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-07 01:02:31 +02:00
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/ntfy#1528
No description provided.