]> git.proxmox.com Git - pve-guest-common.git/commitdiff
vzdump: mailto: use email-or-username-list format
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 15 Feb 2021 12:24:59 +0000 (13:24 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 19 Feb 2021 15:29:58 +0000 (16:29 +0100)
because it is a more complete pattern. Also, 'mailto' was a '-list' format in
PVE 6.2 and earlier, so this also fixes whitespace-related backwards
compatibility. In particular, this fixes creating a backup job in the GUI
without setting an address, which passes along ''.

For example,
> vzdump 153 --mailto " ,,,admin@proxmox.com;;; developer@proxmox.com , ; "
was valid and worked in PVE 6.2.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/VZDump/Common.pm

index 5d93b51e2ca313dd2f8101ba62604889e3b298f0..86cb7bd62db49f334d6b53c7ddfde84b5dc496fc 100644 (file)
@@ -71,9 +71,6 @@ sub parse_dow {
     return $res;
 };
 
-my $mailto_pattern = '[a-zA-Z0-9+._@][-a-zA-Z0-9+._@]*';
-my $mailto_list_pattern = "($mailto_pattern)([;,]$mailto_pattern)*";
-
 my $confdesc = {
     vmid => {
        type => 'string', format => 'pve-vmid-list',
@@ -146,8 +143,7 @@ my $confdesc = {
     },
     mailto => {
        type => 'string',
-       pattern => $mailto_list_pattern,
-       format_description => 'email-or-username-list',
+       format => 'email-or-username-list',
        description => "Comma-separated list of email addresses or users that should" .
            " receive email notifications.",
        optional => 1,