]> git.proxmox.com Git - pve-guest-common.git/blobdiff - PVE/VZDump/Common.pm
vzdump: use regex check for 'mailto'
[pve-guest-common.git] / PVE / VZDump / Common.pm
index 2f3c16e5a743e822b1513ed26905690c1290d670..63a4689e74ec0fcb3e0ee43f4fd5b196a8b37d40 100644 (file)
@@ -60,6 +60,9 @@ 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',
@@ -129,8 +132,10 @@ my $confdesc = {
        optional => 1,
     },
     mailto => {
-       type => 'string', format => 'string-list',
-       description => "Comma-separated list of email addresses that should" .
+       type => 'string',
+       pattern => $mailto_list_pattern,
+       format_description => 'email-or-username-list',
+       description => "Comma-separated list of email addresses or users that should" .
            " receive email notifications.",
        optional => 1,
     },