Feature #14337
closed
Allow SMTP notifications from non-root processes
Added by Denny Page over 1 year ago.
Updated about 1 year ago.
Plus Target Version:
23.09
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 {
- 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)
- Target version changed from 2.7.0 to CE-Next
- 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.
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
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.
- Status changed from Feedback to Resolved
Seems to be working as expected on dev snapshots.
- Target version changed from 2.8.0 to 2.7.1
Also available in: Atom
PDF