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

Dominik Csapak d.csapak at proxmox.com
Fri Feb 12 09:40:16 CET 2021


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!")
-- 
2.20.1






More information about the pbs-devel mailing list