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

Fabian Ebner f.ebner at proxmox.com
Mon Feb 15 09:47:04 CET 2021


I'm going to try and come up with a v2 that re-uses the more complete 
'email' pattern from pve-common.

On 12.02.21 13:23, Fabian Ebner wrote:
> 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 => {
> 





More information about the pve-devel mailing list