View Full Version : Bug?: ERROR 1.Email address is invalid.
edge
13th July 2009, 17:19
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 a@domain.tld, b@domain.tld .... )
Unfortunately ISPconfig3 will give an "ERROR 1.Email address is invalid." when doing so!
Is there maybe a quick fix for this?
till
14th July 2009, 09:25
You can change the regular expression in the form definition file of the mail_user form.
edge
14th July 2009, 10:13
You can change the regular expression in the form definition file of the mail_user form.
Where can I find this mail_user form¿
vogelor
14th July 2009, 11:08
Where can I find this mail_user form¿
debian:
/usr/local/ispconfig/interface/web/mail/form
edge
15th July 2009, 16:58
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?
till
16th July 2009, 11:50
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)) {
edge
20th July 2009, 11:35
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 if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
to: {1,10}
if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{1,10}$/i", $field_value)) {
till
20th July 2009, 12:49
What you changed is the length of the domain suffix. e.g. you would be able to add now things like user@domain.c instead if domain.com. Try this instead:
if(!preg_match("/^\w+[\w.-]*@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
vBulletin® v3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd.