[pve-devel] [PATCH guest-common 1/4] vzdump: loosen mailto pattern to allow whitespaces

Fabian Ebner f.ebner at proxmox.com
Fri Feb 12 13:23:20 CET 2021


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 " ,,,developer at proxmox.com; admin at proxmox.com ; "
was valid and worked in PVE 6.2.

Signed-off-by: Fabian Ebner <f.ebner at 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






More information about the pve-devel mailing list