[GH-ISSUE #1249] Make "MaxMessageBytes" configurable #882

Open
opened 2026-05-07 00:28:25 +02:00 by BreizhHardware · 0 comments

Originally created by @AASluke on GitHub (Jan 4, 2025).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1249

Hi, new user here
I am self hosting using docker. For me the SMTP listener feature is exceptionally useful. But the message size seems to have a hard limit of 1048576 bytes, which I bumped into during first tests with my openmediavault instance:

2025-01-03T22:52:40+0100 omv1 postfix/pickup[158966]: 7343780570: uid=0 from=<root>
2025-01-03T22:52:40+0100 omv1 postfix/cleanup[169905]: 7343780570: message-id=<20250103215240.7343780570@omv1.local>
2025-01-03T22:52:40+0100 omv1 sudo[25336]: pam_unix(sudo:session): session closed for user root
2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 7343780570: from=<omv1@ntfy.local>, size=2448907, nrcpt=2 (queue active)
2025-01-03T22:52:40+0100 omv1 postfix/smtp[169916]: 7343780570: to=<omv1@ntfy.local>, relay=192.168.10.10[192.168.10.10]:8283, delay=0.05, delays=0.04/0.01/0/0, dsn=5.3.4, status=bounced (message size 2448907 exceeds size limit 1048576 of server 192.168.10.10[192.168.10.10])
2025-01-03T22:52:40+0100 omv1 postfix/pipe[169915]: 7343780570: to=<openmediavault-notification@localhost.localdomain>, relay=omvnotificationfilter, delay=0.07, delays=0.04/0.01/0/0.03, dsn=2.0.0, status=sent (delivered via omvnotificationfilter service)
2025-01-03T22:52:40+0100 omv1 postfix/cleanup[169905]: 808818059A: message-id=<20250103215240.808818059A@omv1.local>
2025-01-03T22:52:40+0100 omv1 postfix/bounce[169920]: 7343780570: sender non-delivery notification: 808818059A
2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 808818059A: from=<omv1@ntfy.local>, size=2326, nrcpt=1 (queue active)
2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 7343780570: removed
2025-01-03T22:52:41+0100 omv1 postfix/smtp[169916]: 808818059A: replace: header Subject: Undelivered Mail Returned to Sender: Subject: [omv1.local] Undelivered Mail Returned to Sender
2025-01-03T22:52:41+0100 omv1 postfix/smtp[169916]: 808818059A: to=<omv1@ntfy.local>, relay=192.168.10.10[192.168.10.10]:8283, delay=1, delays=0/1/0.01/0, dsn=2.0.0, status=sent (250 2.0.0 OK: queued)
2025-01-03T22:52:41+0100 omv1 postfix/qmgr[2428]: 808818059A: removed

The message size 2448907 exceeds size limit 1048576 of server 192.168.10.10 (which is the server my ntfy instance is running on). Therefore the ntfy server does not accept it and the message is bounced.
I not a software engineer and spent some time to figure this out - I think here is where this comes from.

So my

💡 Idea/Proposal

is, to add SMTPServerMaxMessageBytes as a configurable value to the config file with the default value, it is currently fixed at.
This way, we could configure it just as other parameters to accept SMTP messages with more than 1MB.

💻 Target components

ntfy server

Looking forward to hearing what you think!

Originally created by @AASluke on GitHub (Jan 4, 2025). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1249 Hi, new user here I am self hosting using docker. For me the [SMTP listener feature](https://docs.ntfy.sh/config/#local-only-email) is exceptionally useful. But the message size seems to have a hard limit of 1048576 bytes, which I bumped into during first tests with my [openmediavault](https://www.openmediavault.org/) instance: ``` 2025-01-03T22:52:40+0100 omv1 postfix/pickup[158966]: 7343780570: uid=0 from=<root> 2025-01-03T22:52:40+0100 omv1 postfix/cleanup[169905]: 7343780570: message-id=<20250103215240.7343780570@omv1.local> 2025-01-03T22:52:40+0100 omv1 sudo[25336]: pam_unix(sudo:session): session closed for user root 2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 7343780570: from=<omv1@ntfy.local>, size=2448907, nrcpt=2 (queue active) 2025-01-03T22:52:40+0100 omv1 postfix/smtp[169916]: 7343780570: to=<omv1@ntfy.local>, relay=192.168.10.10[192.168.10.10]:8283, delay=0.05, delays=0.04/0.01/0/0, dsn=5.3.4, status=bounced (message size 2448907 exceeds size limit 1048576 of server 192.168.10.10[192.168.10.10]) 2025-01-03T22:52:40+0100 omv1 postfix/pipe[169915]: 7343780570: to=<openmediavault-notification@localhost.localdomain>, relay=omvnotificationfilter, delay=0.07, delays=0.04/0.01/0/0.03, dsn=2.0.0, status=sent (delivered via omvnotificationfilter service) 2025-01-03T22:52:40+0100 omv1 postfix/cleanup[169905]: 808818059A: message-id=<20250103215240.808818059A@omv1.local> 2025-01-03T22:52:40+0100 omv1 postfix/bounce[169920]: 7343780570: sender non-delivery notification: 808818059A 2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 808818059A: from=<omv1@ntfy.local>, size=2326, nrcpt=1 (queue active) 2025-01-03T22:52:40+0100 omv1 postfix/qmgr[2428]: 7343780570: removed 2025-01-03T22:52:41+0100 omv1 postfix/smtp[169916]: 808818059A: replace: header Subject: Undelivered Mail Returned to Sender: Subject: [omv1.local] Undelivered Mail Returned to Sender 2025-01-03T22:52:41+0100 omv1 postfix/smtp[169916]: 808818059A: to=<omv1@ntfy.local>, relay=192.168.10.10[192.168.10.10]:8283, delay=1, delays=0/1/0.01/0, dsn=2.0.0, status=sent (250 2.0.0 OK: queued) 2025-01-03T22:52:41+0100 omv1 postfix/qmgr[2428]: 808818059A: removed ``` The **message size 2448907 exceeds size limit 1048576 of server 192.168.10.10** (which is the server my ntfy instance is running on). Therefore the ntfy server does not accept it and the message is bounced. I not a software engineer and spent some time to figure this out - I think [here](https://github.com/binwiederhier/ntfy/blob/630f2957deb670dcacfe0a338091d7561f176b9c/server/server.go#L1670) is where this comes from. So my :bulb: **Idea/Proposal** is, to add `SMTPServerMaxMessageBytes` as a configurable value to the [config file](https://github.com/binwiederhier/ntfy/blob/main/server/config.go) with the default value, it is currently fixed at. This way, we could configure it just as other parameters to accept SMTP messages with more than 1MB. :computer: **Target components** <!-- Where should this feature/enhancement be added? --> ntfy server Looking forward to hearing what you think!
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#882
No description provided.