[pbs-devel] [PATCH proxmox] fix #3302: allow more characters for email
Dominik Csapak
d.csapak at proxmox.com
Thu Apr 8 08:01:49 CEST 2021
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!")
>
More information about the pbs-devel
mailing list