From: Stoiko Ivanov Date: Tue, 2 Feb 2021 13:03:16 +0000 (+0100) Subject: utils: allow '/' inside email address localpart X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=959e331c66d9af1f2d9f02c704096d714e3dfe24;hp=e89b61c5190e3e374c2c3bcb3dce444c64c718cf;p=pmg-api.git utils: allow '/' inside email address localpart The change is motivated by a report in our community forum [0], where a mail addressed to an address containing '/' in its local-part ended up in the quarantine. This is permitted by RFC5322 ([1]), and, probably more relevant, happily accepted and processed by postfix. Once inside the quarantine (or the statistic database) the records cannot be displayed (due to the parameter verification failure). This leaves the user unable to delete the quarantined mail. Apart from the quarantine and statistics the 'pmg-email-address' format is only used in the PBSConfig and the fetchmail configuration (both of which are available only to the admin and can be still be edited irrespective of the set localpart). [0] https://forum.proxmox.com/threads/pmg-error-parameter-verification-failed-400.82353/ [1] https://tools.ietf.org/html/rfc5322 Signed-off-by: Stoiko Ivanov Signed-off-by: Thomas Lamprecht --- diff --git a/src/PMG/Utils.pm b/src/PMG/Utils.pm index 149bcdc..4341dbd 100644 --- a/src/PMG/Utils.pm +++ b/src/PMG/Utils.pm @@ -117,7 +117,7 @@ PVE::JSONSchema::register_standard_option('username', { PVE::JSONSchema::register_standard_option('pmg-email-address', { description => "Email Address (allow most characters).", type => 'string', - pattern => '(?:[^\s\/\\\@]+\@[^\s\/\\\@]+)', + pattern => '(?:[^\s\\\@]+\@[^\s\/\\\@]+)', maxLength => 512, minLength => 3, });