public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH guest-common 1/4] vzdump: loosen mailto pattern to allow whitespaces
@ 2021-02-12 12:23 Fabian Ebner
  2021-02-12 12:23 ` [pve-devel] [PATCH manager 2/4] vzdump: refactor parsing mailto and exclude-path Fabian Ebner
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabian Ebner @ 2021-02-12 12:23 UTC (permalink / raw)
  To: pve-devel

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

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





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-02-15  8:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-12 12:23 [pve-devel] [PATCH guest-common 1/4] vzdump: loosen mailto pattern to allow whitespaces Fabian Ebner
2021-02-12 12:23 ` [pve-devel] [PATCH manager 2/4] vzdump: refactor parsing mailto and exclude-path Fabian Ebner
2021-02-12 12:23 ` [pve-devel] [PATCH manager 3/4] test: vzdump: add tests for mailto Fabian Ebner
2021-02-12 12:23 ` [pve-devel] [PATCH manager 4/4] test: vzdump: rename vzdump_new_retention_test.pl to vzdump_new_test.pl Fabian Ebner
2021-02-15  8:47 ` [pve-devel] [PATCH guest-common 1/4] vzdump: loosen mailto pattern to allow whitespaces Fabian Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal