[pbs-devel] [PATCH proxmox] fix #3302: allow more characters for email

Dietmar Maurer dietmar at proxmox.com
Thu Apr 8 10:07:17 CEST 2021


Please can we define a pub const regex, so that we can use it in the API?

> On 04/08/2021 8:01 AM Dominik Csapak <d.csapak at proxmox.com> wrote:
> 
>  
> any comment? we should really allow at least
> '_' and '+' in addition
> 
> On 2/12/21 9:40 AM, Dominik Csapak wrote:
> > change to something similar as in pve-common
> > word characters, +, -, ~ and . for the local part
> > 
> > Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> > ---
> >   proxmox/src/tools/email.rs | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/proxmox/src/tools/email.rs b/proxmox/src/tools/email.rs
> > index b5d42c4..c6336f4 100644
> > --- a/proxmox/src/tools/email.rs
> > +++ b/proxmox/src/tools/email.rs
> > @@ -16,7 +16,7 @@ pub fn sendmail(
> >       mailfrom: Option<&str>,
> >       author: Option<&str>,
> >   ) -> Result<(), Error> {
> > -    let mail_regex = regex::Regex::new(r"^[a-zA-Z\.0-9-]+@[a-zA-Z\.0-9-]+$").unwrap();
> > +    let mail_regex = regex::Regex::new(r"^[\w\+\-\~\.]+@[a-zA-Z\.0-9-]+$").unwrap();
> >   
> >       if mailto.is_empty() {
> >           bail!("At least one recipient has to be specified!")
> > 
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel





More information about the pbs-devel mailing list