public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fabian Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [pve-devel] [PATCH guest-common 1/4] vzdump: loosen mailto pattern to allow whitespaces
Date: Mon, 15 Feb 2021 09:47:04 +0100	[thread overview]
Message-ID: <4b597086-dd83-ba9b-d9f8-d1a66b80e461@proxmox.com> (raw)
In-Reply-To: <20210212122323.15461-1-f.ebner@proxmox.com>

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@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 => {
> 




      parent reply	other threads:[~2021-02-15  8:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
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 ` Fabian Ebner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b597086-dd83-ba9b-d9f8-d1a66b80e461@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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