From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 591581FF0B7 for ; Fri, 13 Nov 2026 16:15:30 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 70BBD21BA3; Fri, 13 Nov 2026 16:10:12 +0100 (CET) From: Lukas Wagner To: pve-devel@lists.proxmox.com Subject: [PATCH manager 50/55] vzdump: send legacy-sendmail notifications via simplified API Date: Fri, 13 Nov 2026 16:08:23 +0100 Message-ID: <20261113150828.756836-51-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113150828.756836-1-l.wagner@proxmox.com> References: <20261113150828.756836-1-l.wagner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794582529371 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.203 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: KBTZCUULYYVKATIWCYRLGJHZ2S5W47OT X-Message-ID-Hash: KBTZCUULYYVKATIWCYRLGJHZ2S5W47OT X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Instead of passing the full configuration, one can now pass a simplified subset of the sendmail configuration as an optional parameter. In the glue code in libpve-notify-perl, this is translated into a fitting 'recipient' parameter for the notification. Signed-off-by: Lukas Wagner --- PVE/VZDump.pm | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm index 56d2aea3..4137c296 100644 --- a/PVE/VZDump.pm +++ b/PVE/VZDump.pm @@ -545,34 +545,10 @@ sub send_notification { if (($mode eq 'auto' && $email_configured) || $mode eq 'legacy-sendmail') { if ($email_configured && ($policy eq "always" || ($policy eq "failure" && $failed))) { - # Start out with an empty config. Might still contain - # built-ins, so we need to disable/remove them. - my $notification_config = PVE::RS::Notify->parse_config('', ''); - - # Remove built-in matchers, since we only want to send an - # email to the specified recipients and nobody else. - for my $matcher (@{ $notification_config->get_matchers() }) { - $notification_config->delete_matcher($matcher->{name}); - } - - # <, >, @ are not allowed in endpoint names, but that is only - # verified once the config is serialized. That means that - # we can rely on that fact that no other endpoint with this name exists. - my $endpoint_name = "<" . join(",", @$mailto) . ">"; - $notification_config->add_sendmail_endpoint({ - name => $endpoint_name, + my $notification_config = { mailto => $mailto, author => "vzdump backup tool", - }); - - my $endpoints = [$endpoint_name]; - - # Add a matcher that matches all notifications, set our - # newly created target as a target. - $notification_config->add_matcher({ - name => "", - target => $endpoints, - }); + }; PVE::Notify::notify( $severity, "vzdump", $template_data, $fields, $notification_config, -- 2.47.3