mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-15 03:58:26 +00:00
vzdump: use <name> as a convention for virtual endpoints/groups
Virtual (or anonymous) endpoints/groups are used for sending one-off notifications to a target that does not exist in the config. VZDump uses this to send out notification mails to those addresses configured by the `mailto` parameter. Suggested-by: Wolfgang Bumiller <w.bumiller@proxmox.com> Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
This commit is contained in:
parent
51f54177e9
commit
e5721b9062
@ -501,10 +501,10 @@ sub send_notification {
|
|||||||
my $notification_config = PVE::Notify::read_config();
|
my $notification_config = PVE::Notify::read_config();
|
||||||
|
|
||||||
if ($mailto && scalar(@$mailto)) {
|
if ($mailto && scalar(@$mailto)) {
|
||||||
# <, >, @ is not allowed in endpoint names, but only it is only
|
# <, >, @ are not allowed in endpoint names, but that is only
|
||||||
# verified once the config is serialized. That means that
|
# verified once the config is serialized. That means that
|
||||||
# we can rely on that fact that no other endpoint with this name exists.
|
# we can rely on that fact that no other endpoint with this name exists.
|
||||||
my $endpoint_name = "mail-to-<" . join(",", @$mailto) . ">";
|
my $endpoint_name = "<mail-to-" . join(",", @$mailto) . ">";
|
||||||
$notification_config->add_sendmail_endpoint(
|
$notification_config->add_sendmail_endpoint(
|
||||||
$endpoint_name,
|
$endpoint_name,
|
||||||
$mailto,
|
$mailto,
|
||||||
@ -520,7 +520,7 @@ sub send_notification {
|
|||||||
push @$endpoints, $target;
|
push @$endpoints, $target;
|
||||||
}
|
}
|
||||||
|
|
||||||
$target = "group-$endpoint_name";
|
$target = "<group-$endpoint_name>";
|
||||||
$notification_config->add_group(
|
$notification_config->add_group(
|
||||||
$target,
|
$target,
|
||||||
$endpoints,
|
$endpoints,
|
||||||
|
Loading…
Reference in New Issue
Block a user