Today I wanted to add some new e-mail addresses to one of the domains on ISPconfig3 Some of the e-mail addresses are single letter once (like [email protected], [email protected] .... ) Unfortunately ISPconfig3 will give an "ERROR 1.Email address is invalid." when doing so! Is there maybe a quick fix for this?
I've had a look at the files in /usr/local/ispconfig/interface/web/mail/form, but I can not find the regular expression that is handeling this. Any more clues?
Sorry, the email regex is defined in the global form handling file /usr/local/ispconfig/interface/lib/classes/tform.inc.php Around line 643 you will find the regular expression for the email address validation: if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
I found it, but unfortinatly it did not work for me. I guess I'm doing something wrong. I've changed the {2,10} part in PHP: if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) { to: {1,10} PHP: if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{1,10}$/i", $field_value)) {
What you changed is the length of the domain suffix. e.g. you would be able to add now things like [email protected] instead if domain.com. Try this instead: if(!preg_match("/^\w+[\w.-]*@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {