lib/Kolab

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Mon May 2 20:53:24 CEST 2011


 lib/Kolab/LDAP.pm |   37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

New commits:
commit 904e3a168a7446719e3d4f17e39843a8812ca7df
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Mon May 2 14:51:53 2011 -0400

    Update Kolab's logic to determine whether or not to create the mailbox on the local server

diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm
index 588a33f..9afb410 100644
--- a/lib/Kolab/LDAP.pm
+++ b/lib/Kolab/LDAP.pm
@@ -468,24 +468,31 @@ sub createObject
         return;
     }
 
-    if (($kolabhomeserver && $kolabhomeserver ne lc($Kolab::config{'fqdnhostname'}))) {
-        # We are not on the home server
-        if( $p eq 'sf' ) {
-            # Dont create shared folders on other hosts than it's kolabhomeserver
-            Kolab::log('L', "Kolab::LDAP::createObject() skipping shared folder for other server $kolabhomeserver", KOLAB_DEBUG);
+    if ((!$kolabhomeserver) || lc($kolabhomeserver) ne lc($Kolab::config{'fqdnhostname'})) {
+        # kolabHomeServer (or equivalent attribute) is not set, OR
+        # kolabHomeServer (or equiv. attr.) does not match our configured FQDN, and so
+        # whether or not we will create the object depends on whether the object has
+        # the 'kolabHomeServerOnly' attribute available and set to 'true'.
+        #
+        my $kolabhomeserveronly = $object->get_value('kolabhomeserveronly') || 0;
+
+        if ($kolabhomeserveronly) {
+            # If 'kolabHomeServerOnly' is set to true, but we are not 'kolabHomeServer',
+            # then ignore.
             return;
-        }
-        my $kolabhomeserveronly = $object->get_value('kolabhomeserveronly');
-        if( defined($kolabhomeserveronly) && $kolabhomeserveronly eq 'true' ) {
-            # Don't create the user's mailbox if it should be created on the kolabHomeServer only
-            Kolab::log('L', "Kolab::LDAP::createObject() skipping user mailbox creation for other server $kolabhomeserver", KOLAB_DEBUG);
+        } else {
+            # Otherwise, do create.
+            #
+            # TODO:
+            #
+            # - Once the mailbox is created, set the 'kolabHomeServer' or equivalent attribute to
+            #   this server, so mail routing actually ends up with this server.
             return;
         }
-        Kolab::log('L', "Kolab::LDAP::createObject() for other server than $kolabhomeserver. TODO: Create referral or something, for now we just create an empty INBOX", KOLAB_DEBUG);
-        # We create INBOX on other servers also, to allow access to shared/published
-        # folders on those servers because some IMAP clients abort the connection
-        # to an IMAP server if they cannot access the INBOX.
-        $islocal = 0;
+    } else {
+        # kolabHomeServer or equivalent attribute *IS* set, OR
+        # kolabHomeServer does match our (configured) FQDN.
+        # If so, be happy and smile to the camera.
     }
 
     if (!$cyrus) {





More information about the commits mailing list