[GH-ISSUE #645] [SMTP] Allow unsecured mailservers #480

Closed
opened 2026-05-07 00:24:36 +02:00 by BreizhHardware · 4 comments

Originally created by @sharknoon on GitHub (Mar 2, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/645

Hello,

I have ntfy deployed in a containerized environment with docker. There I have an external mailserver (SMTP) that is only accessible via a docker network. My mailserver has no authentification, because it is not public. Only containers in the same network can access it.

When I leave the field smtp-sender-user / smtp-sender-pass blank, the error is the following:

Mismatched type for flag 'smtp-sender-user'. Expected 'string' but actual is ''

When I comment it out, the error is the following:

if smtp-sender-addr is set, base-url, smtp-sender-user, smtp-sender-pass and smtp-sender-from must also be set

This error comes from here.

I would be very happy, if we would allow mailservers without auth. Especially for cases, where the mailserver is exclusive to ntfy by being bundled in the same docker-compose network.

Btw Thank you @binwiederhier for making such a great app and putting so much effort in it, I am loving ntfy :)

Kind regards from the southwest of germany (Stuttgart)

Sharknoon

Originally created by @sharknoon on GitHub (Mar 2, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/645 Hello, I have ntfy deployed in a containerized environment with docker. There I have an external mailserver (SMTP) that is only accessible via a docker network. My mailserver has no authentification, because it is not public. Only containers in the same network can access it. When I leave the field `smtp-sender-user` / `smtp-sender-pass` blank, the error is the following: ``` Mismatched type for flag 'smtp-sender-user'. Expected 'string' but actual is '' ``` When I comment it out, the error is the following: ``` if smtp-sender-addr is set, base-url, smtp-sender-user, smtp-sender-pass and smtp-sender-from must also be set ``` This error comes from [here](https://github.com/binwiederhier/ntfy/blob/64b3c3c2fade0d88e5c4dc7b8c4d550d5935e459/cmd/serve.go#L181). I would be very happy, if we would allow mailservers without auth. Especially for cases, where the mailserver is exclusive to ntfy by being bundled in the same docker-compose network. Btw Thank you @binwiederhier for making such a great app and putting so much effort in it, I am loving ntfy :) Kind regards from the southwest of germany (Stuttgart) Sharknoon
BreizhHardware 2026-05-07 00:24:36 +02:00
Author
Owner

@binwiederhier commented on GitHub (Mar 3, 2023):

I implemented this in github.com/binwiederhier/ntfy@90db1283dd

Sadly I do not have an SMTP server without to test this with, but I'm pretty sure it'll work. If you know how to build ntfy, you can build the latest main branch. If not, I built an amd64 version for you here:

curl https://ntfy.sh/file/gEmVMKDSMFTI.bin > ntfy-snap
chmod +x ntfy-snap
./ntfy-snap
<!-- gh-comment-id:1452817413 --> @binwiederhier commented on GitHub (Mar 3, 2023): I implemented this in https://github.com/binwiederhier/ntfy/commit/90db1283dd7e769973f8e32f08c4737e37f6fb5f Sadly I do not have an SMTP server without to test this with, but I'm pretty sure it'll work. If you know how to build ntfy, you can build the latest `main` branch. If not, I built an amd64 version for you here: ``` curl https://ntfy.sh/file/gEmVMKDSMFTI.bin > ntfy-snap chmod +x ntfy-snap ./ntfy-snap ```
Author
Owner

@binwiederhier commented on GitHub (Mar 3, 2023):

I'm closing this ticket since I assume it works, If it doesn't, please let me know.

<!-- gh-comment-id:1452817680 --> @binwiederhier commented on GitHub (Mar 3, 2023): I'm closing this ticket since I assume it works, If it doesn't, please let me know.
Author
Owner

@sharknoon commented on GitHub (Mar 3, 2023):

Thank you so much for your very fast implementation. I was already working on a pull request, made the same changes, but you were faster :) Thanks!

<!-- gh-comment-id:1453101485 --> @sharknoon commented on GitHub (Mar 3, 2023): Thank you so much for your very fast implementation. I was already working on a pull request, made the same changes, but you were faster :) Thanks!
Author
Owner

@binwiederhier commented on GitHub (Mar 3, 2023):

I'm sorry I took that from you. It just felt so easy, and I sometimes like doing easy things inbetween all the weird and complicated stuff.

<!-- gh-comment-id:1453623027 --> @binwiederhier commented on GitHub (Mar 3, 2023): I'm sorry I took that from you. It just felt so easy, and I sometimes like doing easy things inbetween all the weird and complicated stuff.
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#480
No description provided.