to make it more compatible to what we had previously. In pve-manger,
split_list() is called on the parameter, so any whitespaces and even stand-alone
',' and ';' are taken care of, leaving only the real addresses. This also fixes
creating a backup job with empty mailto in the UI.

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

Signed-off-by: Fabian Ebner <f.eb...@proxmox.com>
---
 PVE/VZDump/Common.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/VZDump/Common.pm b/PVE/VZDump/Common.pm
index af141de..fb11b3d 100644
--- a/PVE/VZDump/Common.pm
+++ b/PVE/VZDump/Common.pm
@@ -72,7 +72,7 @@ sub parse_dow {
 };
 
 my $mailto_pattern = '[a-zA-Z0-9+._@][-a-zA-Z0-9+._@]*';
-my $mailto_list_pattern = "($mailto_pattern)([;,]$mailto_pattern)*";
+my $mailto_list_pattern = qr/([;,]?(?:$mailto_pattern|\s*))*/;
 
 my $confdesc = {
     vmid => {
-- 
2.20.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to