Feature #14337
closedAllow SMTP notifications from non-root processes
100%
Description
The changes to address #14031 removed the ability for non root processes to send notifications. This one line change restores that functionality:
--- notices.inc.old 2023-04-23 09:44:28.161806000 -0700 +++ notices.inc 2023-05-02 09:36:47.548761000 -0700 @@ -356,7 +356,7 @@ /* Store last message sent to avoid spamming */ @file_put_contents("/var/db/notices_lastmsg.txt", $message); - if (!$force) { + if ($force == false && posix_geteuid() == 0) { notify_via_queue_add($message, 'mail'); $ret = true; } else {
Updated by Jim Pingle over 1 year ago
- Tracker changed from Regression to Feature
- Assignee set to Jim Pingle
- Target version set to 2.7.0
- Plus Target Version set to 23.09
- Affected Version deleted (
2.7.x) - Affected Architecture deleted (
All)
Updated by Jim Pingle over 1 year ago
- Target version changed from 2.7.0 to CE-Next
Updated by Jim Pingle about 1 year ago
- Subject changed from Allow notifications non root processes to Allow SMTP notifications from non-root processes
- Status changed from New to In Progress
- Target version changed from CE-Next to 2.8.0
I have an alternate idea on how to fix this and (hopefully) also preserve the duplicate message suppression. There is also quite a bit of code in notices.inc that needs updated for PHP 8.x.
I'm partway through making the necessary changes here and then I need to test it quite a bit before I commit it.
Updated by Jim Pingle about 1 year ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Applied in changeset 596a88fa42f0ac77bd2fc2be87b54457df11f64b.
Updated by Jim Pingle about 1 year ago
With the changes I just pushed, I get working SMTP notifications from NUT as well as other users. No duplicates/loops or any other issues that I can see thus far.
No changes need to be made to nut or anything else that sends notifications, it's all handled on the backend.
Not 100% fond of the solution but it's not any worse off than it was before.
Updated by Jim Pingle about 1 year ago
- Status changed from Feedback to Resolved
Seems to be working as expected on dev snapshots.
Updated by Jim Pingle about 1 year ago
- Target version changed from 2.8.0 to 2.7.1