--- kolabd/kolabd/templates/sharedfolders.pcre.template.in.orig	1970-01-01 01:00:00.000000000 +0100
+++ kolabd/kolabd/templates/sharedfolders.pcre.template.in	2007-01-28 16:01:11.000000000 +0100
@@ -0,0 +1,10 @@
+KOLAB_META_START
+TARGET=@emailserver_confdir@/sharedfolders.pcre
+PERMISSIONS=0640
+OWNERSHIP=@emailserver_usr@:@emailserver_grp@
+KOLAB_META_END
+# Handle delivery to subfolder of shared folder, 
+# discovered by presence of / in localpart
+# which means a / before a +
+# a / after a + is just delivery to a users subfolder.
+/^([^\+]+\/.+)$/ kolab+shared/${1} 
Index: kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php.in
===================================================================
RCS file: /home/kroupware/jail/kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php.in,v
retrieving revision 1.6
diff -u -r1.6 sf.php.in
--- kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php.in	18 Jan 2007 13:11:18 -0000	1.6
+++ kolab-webadmin/kolab-webadmin/www/admin/sharedfolder/sf.php.in	28 Jan 2007 14:46:33 -0000
@@ -133,7 +133,11 @@
 				  'acl_0' => array( 'name' => _('Permission for UID/GID'),
 									'type' => 'aclselect',
 									'user' => 'anyone',
-									'perm' => 'all' ));
+									'perm' => 'all' ),
+				  'acl_1' => array( 'name' => _('Permission for UID/GID'),
+									'type' => 'aclselect',
+									'user' => 'anonymous',
+									'perm' => 'post' ));
 
 
 $entries['action'] = array( 'name' => 'action',
@@ -181,6 +185,10 @@
 		$cn = str_replace( utf8_decode('ß'), 'ss', $cn );
 		debug("cn=$cn");
 		$ldap_object['cn'] = utf8_encode($cn);
+
+                // Add alias and mail 
+                $ldap_object['alias'] = $cn;
+                $ldap_object['mail'] = "kolab+shared/" . $cn;
 
 		if (!empty($_POST['foldertype']))
 		  $ldap_object['kolabFolderType'] = $_POST['foldertype'];
Index: kolabd/kolabd/kolab2.schema
===================================================================
RCS file: /home/kroupware/jail/kolabrepository/server/kolabd/kolabd/kolab2.schema,v
retrieving revision 1.20
diff -u -r1.20 kolab2.schema
--- kolabd/kolabd/kolab2.schema	8 Aug 2006 16:18:32 -0000	1.20
+++ kolabd/kolabd/kolab2.schema	28 Jan 2007 14:46:33 -0000
@@ -565,6 +565,7 @@
   SUP top STRUCTURAL
   MUST cn
   MAY ( acl $
+        mail $
         alias $
         cyrus-userquota $
         kolabHomeServer $
Index: kolabd/kolabd/templates/main.cf.template.in
===================================================================
RCS file: /home/kroupware/jail/kolabrepository/server/kolabd/kolabd/templates/main.cf.template.in,v
retrieving revision 1.12
diff -u -r1.12 main.cf.template.in
--- kolabd/kolabd/templates/main.cf.template.in	26 Sep 2006 18:22:42 -0000	1.12
+++ kolabd/kolabd/templates/main.cf.template.in	28 Jan 2007 14:46:33 -0000
@@ -71,7 +71,9 @@
 canonical_maps = hash:@emailserver_confdir@/canonical
 virtual_maps =  hash:@emailserver_confdir@/virtual, 
 	ldap:@emailserver_confdir@/ldapdistlist.cf, 
-	ldap:@emailserver_confdir@/ldapvirtual.cf
+	ldap:@emailserver_confdir@/ldapvirtual.cf,
+        pcre:@emailserver_confdir@/sharedfolders.pcre
+
 relocated_maps = hash:@emailserver_confdir@/relocated
 transport_maps = hash:@emailserver_confdir@/transport, ldap:@emailserver_confdir@/ldaptransport.cf
 alias_maps = hash:@aliases_file@
Index: perl-kolab/Kolab-Cyrus/Cyrus.pm
===================================================================
RCS file: /home/kroupware/jail/kolabrepository/server/perl-kolab/Kolab-Cyrus/Cyrus.pm,v
retrieving revision 1.8
diff -u -r1.8 Cyrus.pm
--- perl-kolab/Kolab-Cyrus/Cyrus.pm	26 Mar 2006 21:55:30 -0000	1.8
+++ perl-kolab/Kolab-Cyrus/Cyrus.pm	28 Jan 2007 14:46:33 -0000
@@ -79,7 +79,7 @@
     my $seperator = '/';
     my $uidprefix = 'user';
     if ($sf) { 
-      $seperator = '.'; 
+      $seperator = '/'; 
       $uidprefix = 'shared';
     } 
     return $uidprefix . $seperator . $user;
Index: perl-kolab/Kolab-LDAP/LDAP.pm.in
===================================================================
RCS file: /home/kroupware/jail/kolabrepository/server/perl-kolab/Kolab-LDAP/LDAP.pm.in,v
retrieving revision 1.6
diff -u -r1.6 LDAP.pm.in
--- perl-kolab/Kolab-LDAP/LDAP.pm.in	30 Jul 2006 21:20:43 -0000	1.6
+++ perl-kolab/Kolab-LDAP/LDAP.pm.in	28 Jan 2007 14:46:34 -0000
@@ -228,7 +228,7 @@
     elsif( lc $perm eq 'read hidden' ) { $_ = "$uid rs"; }
     elsif( lc $perm eq 'append' ) { $_ = "$uid lrsip"; }
     elsif( lc $perm eq 'write' ) { if( $sf ) { $_ = "$uid lrsiwdp"; } else { $_ = "$uid lrsiwcdp"; } }
-    elsif( lc $perm eq 'all' ) { if( $sf ) { $_ = "$uid lrsiwdap"; } else { $_ = "$uid lrsiwcdap"; } }
+    elsif( lc $perm eq 'all' ) { $_ = "$uid lrsiwcdap"; }
     else { $_ = "$uid $perm"; } # passthrough
     if( $post ) { $_ .= 'p'; }
     Kolab::log('L', "Kolab::LDAP::mapAcls() acl=$_", KOLAB_DEBUG);
@@ -279,7 +279,7 @@
     # We accept domain encoded in CN...
     if( $p eq 'sf' && index( $uid, '@' ) < 0 ) {
       # We have to create shared folders
-      # with names shared.<fldrname>@<domain>
+      # with names shared/<fldrname>@<domain>
       my @dcs = split(/,/,$object->dn());
       my @dn;
       while( pop( @dcs ) =~ /dc=(.*)/ ) {

