[Kolab-devel] kolab_2_1_branch in CVS! (was: Re: martin: server/kolab-webadmin/kolab-webadmin/www/admin/user user.php.in, 1.19, 1.20)

Gunnar Wrobel wrobel at pardus.de
Tue Jul 17 06:36:33 CEST 2007


Thomas Arendsen Hein <thomas at intevation.de> writes:

> * Gunnar Wrobel <wrobel at pardus.de> [20070713 16:40]:
>> This commit contains syntax errors.
>> 
>> cvs at kolab.org writes:
>> 
>> > Martin Konold: unfinished support for kolabAllowSMTPRecipient (I am tired now)
>> >
>> > RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/user.php.in,v
>> > retrieving revision 1.19
>> > retrieving revision 1.20
>> > diff -u -d -r1.19 -r1.20
>> > --- user.php.in	28 May 2007 19:24:10 -0000	1.19
>> > +++ user.php.in	2 Jul 2007 22:33:47 -0000	1.20
>> > @@ -165,6 +165,49 @@
>> >    return '';
>> >  }
>> >  
>> > +function valid_email_address($address) {
>> > +// the following addresses are invalid
>> > +// email1.. at kolab.org
>> > +// email1.- at kolab.org
>> > +// email1._ at kolab.org
>> > +// email1 at 2sub.kolab.org
>> > +// email1 at sub.sub.2sub.kolab.org
>> > +  return preg_match("/^[a-z]+[a-z0-9]*[\.|\-|_]?[a-z0-9]+@([a-z]+[a-z0-9]*[\.|\-]?[a-z]+[a-z0-9]*[a-z0-9]+){1,4}\.[a-z]{2,4}$/i", $address));
>> > +}
>> > +
>> > +function valid_domain($domain) {
>> > +// the following subdomains are invalid
>> > +// 2sub.kolab.org
>> > +// sub.sub.2sub.kolab.org
>> > +  return preg_match("/^[a-z]+[a-z0-9]*[\.|\-]?[a-z]+[a-z0-9]*[a-z0-9]+){1,4}\.[a-z]{2,4}$/i", $domain));
>> > +}
>> > +
>> > +function valid_local_part($local_part) {
>> > +  // the local part always has an @ appended
>> > +  return preg_match("/^[a-z]+[a-z0-9]*[\.|\-|_]?[a-z0-9]+@/i", $local_part));
>> > +}
>
> These expressions are a little bit limited, we have real world email
> addresses with more than one dot (thomas.arendsen.hein), starting
> with decimal digits or containing e.g. "+" characters.

I was wondering about these too. Maybe we could use something like this recipe:

http://www.secureprogramming.com/?action=view&feature=recipes&recipeid=3

Cheers,

Gunnar

-- 
____ http://www.pardus.de _________________ http://gunnarwrobel.de _

    >> Mail at ease - Rent a kolab groupware server at p at rdus <<

p at rdus Kolab work is funded in part by KDAB and the Kolab Konsortium




More information about the devel mailing list