[pve-devel] [PATCH pve-cluster 08/11] datacenter config: add new parameters for system mail forwarding

Lukas Wagner l.wagner at proxmox.com
Thu Aug 31 13:06:18 CEST 2023


This commit adds two new paramters to the 'notify' property string:
  - 'system-mail': Determine whether mails to root should be forwarded
    by the notification system
  - 'system-mail-target': Determine the target to which the
    notification should be forwarded to.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 src/PVE/DataCenterConfig.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 09be6eb..e2619c5 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -116,6 +116,28 @@ my $notification_format = {
 	    . " to root via a 'sendmail' notification endpoint.",
 	optional => 1,
     },
+    'system-mail' => {
+	type => 'string',
+	enum => ['always', 'never'],
+	description => "Control if mails to the 'root' user should be forwarded.",
+	verbose_description => "Control if mails to the 'root' user should be forwarded.\n"
+	    . "* 'always' forward always\n"
+	    . "* 'never' forward never.\n"
+	    . "For production systems, turning off mail forwarding is not"
+	    . "recommended!\n",
+	default => 'always',
+	optional => 1,
+    },
+    'target-system-mail' => {
+	type => 'string',
+	format_description => 'TARGET',
+	description => "Control where mails to the 'root' user should be forwarded to.",
+	verbose_description => "Control where mails to the 'root' user should be forwarded to."
+	    . " Has to be the name of a notification target (endpoint or notification group)."
+	    . " If the 'target-system-mail' parameter is not set, the system will send mails"
+	    . " to root via a 'sendmail' notification endpoint.",
+	optional => 1,
+    },
 };
 
 register_standard_option('pve-ha-shutdown-policy', {
-- 
2.39.2






More information about the pve-devel mailing list