
13th July 2009, 16:19
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
Bug?: ERROR 1.Email address is invalid.
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?
|

14th July 2009, 08:25
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
|
|
You can change the regular expression in the form definition file of the mail_user form.
|

14th July 2009, 09:13
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
Quote:
Originally Posted by till
You can change the regular expression in the form definition file of the mail_user form.
|
Where can I find this mail_user form¿
|

14th July 2009, 10:08
|
|
ISPConfig Developer
|
|
Join Date: Jan 2007
Location: Wernau, Germany
Posts: 219
Thanks: 42
Thanked 34 Times in 24 Posts
|
|
Quote:
Originally Posted by edge
Where can I find this mail_user form¿
|
debian:
/usr/local/ispconfig/interface/web/mail/form
|
|
The Following User Says Thank You to vogelor For This Useful Post:
|
edge (15th July 2009)
|

15th July 2009, 15:58
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
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?
|

16th July 2009, 10:50
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
|
|
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)) {
|
|
The Following User Says Thank You to till For This Useful Post:
|
edge (20th July 2009)
|

20th July 2009, 10:35
|
|
Moderator
|
|
Join Date: Dec 2005
Location: The Netherlands
Posts: 2,010
Thanks: 254
Thanked 134 Times in 120 Posts
|
|
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 Code:
if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) {
to: {1,10}
PHP Code:
if(!preg_match("/^\w+[\w.-]*\w+@\w+[\w.-]*\w+\.[a-z]{1,10}$/i", $field_value)) {
|

20th July 2009, 11:49
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,198 Times in 3,213 Posts
|
|
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)) {
|
|
The Following User Says Thank You to till For This Useful Post:
|
edge (20th July 2009)
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 09:00.
|
Recent comments
1 day 7 hours ago
1 day 12 hours ago
1 day 17 hours ago
1 day 18 hours ago
2 days 9 hours ago
2 days 9 hours ago
2 days 14 hours ago
2 days 20 hours ago
2 days 21 hours ago
2 days 22 hours ago