From 38103c00c1444d67f48d455c0e45fb22e15a8ce0 Mon Sep 17 00:00:00 2001 From: Demian Date: Mon, 6 Feb 2023 16:17:52 +0100 Subject: [PATCH 1/2] Fixed regex for dkim_selector to match only valid entires #6459 before the regex matched empty entries and entries starting with a number. --- interface/web/mail/form/mail_domain.tform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/web/mail/form/mail_domain.tform.php b/interface/web/mail/form/mail_domain.tform.php index 6e768193e0..30212be00e 100644 --- a/interface/web/mail/form/mail_domain.tform.php +++ b/interface/web/mail/form/mail_domain.tform.php @@ -132,7 +132,7 @@ $form["tabs"]['domain'] = array ( 'width' => '20', 'maxlength' => '63', 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-z0-9]{0,63}$/', + 'regex' => '/^[a-z][a-z0-9]{1,63}$/', 'errmsg'=> 'dkim_selector_error'), ), ), -- GitLab From 280c16b99970d06334bd8950913512f25540de29 Mon Sep 17 00:00:00 2001 From: Demian Date: Tue, 7 Feb 2023 08:35:37 +0100 Subject: [PATCH 2/2] Fixed regex to match the dkim_slector RFC compliant #6459 The dkim_select can start with a number, but has to contain atleast 1 letter and has to be between 1 and 63 characters long. --- interface/web/mail/form/mail_domain.tform.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/web/mail/form/mail_domain.tform.php b/interface/web/mail/form/mail_domain.tform.php index 30212be00e..4a042abf2e 100644 --- a/interface/web/mail/form/mail_domain.tform.php +++ b/interface/web/mail/form/mail_domain.tform.php @@ -132,7 +132,7 @@ $form["tabs"]['domain'] = array ( 'width' => '20', 'maxlength' => '63', 'validators' => array ( 0 => array ( 'type' => 'REGEX', - 'regex' => '/^[a-z][a-z0-9]{1,63}$/', + 'regex' => '/^(?=.*[a-z])[a-z0-9]{1,63}$/', 'errmsg'=> 'dkim_selector_error'), ), ), -- GitLab